This is the inverse problem to Problem 1485. Problem 1485 illustrates the method of differences takes a sequence and takes successive differences till it hits a constant. The output was the initial values and the final common difference. This output can be used to regenerate the original sequence. Thus this problem.
Use the initial value and difference vector in the form output in 1485 and generate first n values of the sequence.
Ex: Consider the vector [1 3 2]. The last value '2' is the second order difference and the previous values are the initial values. This generates the sequence [1 4 9 16 25 36 ... ]
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers25
Suggested Problems
-
The Goldbach Conjecture, Part 2
2413 Solvers
-
1375 Solvers
-
Get the area codes from a list of phone numbers
1072 Solvers
-
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
2038 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
399 Solvers
More from this Author10
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!