Now we pick thefirst Δn withwhere the smallest sum of the absolute of everyeach value. If two Δ's has the same is less than than sum, we pick of the later oneabsolute values of Δn+1. In this case it is Δ5: 1,0,-1,0,0,0
. Now we duplicate the last value. (1,0,-1,0,0,0,0
). Now we repeatedly take the running sums of this list n times, successfully undoing all the "difference between every adjacent element" function, but because we have an extra element, we will have an extra element in this new sequence. In our chosen sequence, this new sequence is 1,4,9,16,25,36,49
.
Another example would be the sequence 2,5,3,9,6,2,3
(unlike the previous sequence, this one doesn't follow a clear pattern). The sum of the absolutes of this sequence is 30. Δ1 of this sequence is 2,3,-2,6,-3,-4,1
. The sum of the absolutes this time is 21. We continue, Δ2 is 2,1,-5,8,-9,-1,5
. The sum of the absolutes is 31. Now, we can see that Δ1 hasis the smallestfirst with a smaller absolute sum ofthan the absolutesnext Δ in the series. Now, we duplicate the last value of Δ1, giving 2,3,-2,6,-3,-4,1,1
. Since this is Δ1, we take the running sums 1 time giving 2,5,3,9,6,2,3,4
as a final result.
Now we pick the Δn with the smallest sum of the absolute of every value. If two Δ's has the same sum, we pick the later one. In this case it is Δ5: 1,0,-1,0,0,0
. Now we duplicate the last value. (1,0,-1,0,0,0,0
). Now we repeatedly take the running sums of this list n times, successfully undoing all the "difference between every adjacent element" function, but because we have an extra element, we will have an extra element in this new sequence. In our chosen sequence, this new sequence is 1,4,9,16,25,36,49
.
Another example would be the sequence 2,5,3,9,6,2,3
(unlike the previous sequence, this one doesn't follow a clear pattern). The sum of the absolutes of this sequence is 30. Δ1 of this sequence is 2,3,-2,6,-3,-4,1
. The sum of the absolutes this time is 21. We continue, Δ2 is 2,1,-5,8,-9,-1,5
. The sum of the absolutes is 31. Now, we can see that Δ1 has the smallest sum of the absolutes. Now, we duplicate the last value of Δ1, giving 2,3,-2,6,-3,-4,1,1
. Since this is Δ1, we take the running sums 1 time giving 2,5,3,9,6,2,3,4
as a final result.
Now we pick first Δn where the sum of the absolute of each value is less than than sum of the absolute values of Δn+1. In this case it is Δ5: 1,0,-1,0,0,0
. Now we duplicate the last value. (1,0,-1,0,0,0,0
). Now we repeatedly take the running sums of this list n times, successfully undoing all the "difference between every adjacent element" function, but because we have an extra element, we will have an extra element in this new sequence. In our chosen sequence, this new sequence is 1,4,9,16,25,36,49
.
Another example would be the sequence 2,5,3,9,6,2,3
(unlike the previous sequence, this one doesn't follow a clear pattern). The sum of the absolutes of this sequence is 30. Δ1 of this sequence is 2,3,-2,6,-3,-4,1
. The sum of the absolutes this time is 21. We continue, Δ2 is 2,1,-5,8,-9,-1,5
. The sum of the absolutes is 31. Now, we can see that Δ1 is the first with a smaller absolute sum than the next Δ in the series. Now, we duplicate the last value of Δ1, giving 2,3,-2,6,-3,-4,1,1
. Since this is Δ1, we take the running sums 1 time giving 2,5,3,9,6,2,3,4
as a final result.
Predict the next number in any sequencesequencer
Another example would be the sequence 2,5,3,9,6,2,3
(unlike the previous sequence, this one doesn't follow a clear pattern). The sum of the absolutes of this sequence is 30. Δ1 of this sequence is 2,3,-2,6,-3,-4,1
. The sum of the absolutes this time is 21. We continue, Δ2 is 2,1,-5,8,-9,-1,5
. The sum of the absolutes is 31. Now, we can see that Δ1 has the smallest sum of the absolutes. Now, we duplicate the last value of Δ1, giving 2,3,-2,6,-3,-4,1,1
. Since this is Δ1, we take the running sums 1 time giving 2,5,3,9,6,2,3,4
as a final result.
Here's my code.
Predict the next number in any sequence
Here's my code.
Predict the next number in any sequencer
Another example would be the sequence 2,5,3,9,6,2,3
(unlike the previous sequence, this one doesn't follow a clear pattern). The sum of the absolutes of this sequence is 30. Δ1 of this sequence is 2,3,-2,6,-3,-4,1
. The sum of the absolutes this time is 21. We continue, Δ2 is 2,1,-5,8,-9,-1,5
. The sum of the absolutes is 31. Now, we can see that Δ1 has the smallest sum of the absolutes. Now, we duplicate the last value of Δ1, giving 2,3,-2,6,-3,-4,1,1
. Since this is Δ1, we take the running sums 1 time giving 2,5,3,9,6,2,3,4
as a final result.
Here's my code.