Post Reply 
(12C Platinum) Sums of Powers of N numbers
01-25-2019, 03:02 PM (This post was last modified: 12-09-2020 11:43 AM by Albert Chan.)
Post: #10
RE: (12C Platinum) Sums of Powers of N numbers
Another trick about polynomial interpolation is do slopes.

Code:
N Sum Offset=(4,100)        Offset=(3,64)          Offset=(2,18.5)         Offset=(1,3)
4 100
3 36  (100-36)/(4-3) = 64
2 9   (100-9)/(4-2) = 45.5  (64-45.5)/(3-2) = 18.5 
1 1   (100-1)/(4-1) = 33    (64-33)/(3-1) = 15.5   (18.5-15.5)/(2-1) = 3
0 0   (100-0)/(4-0) = 25    (64-25)/(3-0) = 13     (18.5-13)/(2-0) = 2.75  (3-2.75)/(1-0) = 0.25

To get the actual interpolated values, undo Offset(s):

Sum of N cubes = (((0.25 * (N-1) + 3) * (N-2) + 18.5) * (N-3) + 64) * (N-4) + 100

If above points order were reversed, we get different, but equivalent formula:

Sum of N cubes = (((0.25 * (N-3) + 2) * (N-2) + 3.5) * (N-1) + 1) * N
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (12C Platinum) Sums of Powers of N numbers - Albert Chan - 01-25-2019 03:02 PM



User(s) browsing this thread: 1 Guest(s)