Summation on HP 42S
09-24-2018, 04:20 PM (This post was last modified: 09-24-2018 04:42 PM by Albert Chan.)
Post: #16
 Albert Chan Senior Member Posts: 2,004 Joined: Jul 2018
RE: Summation on HP 42S
(09-24-2018 01:52 PM)Thomas Klemm Wrote:
Quote:I normally just fit the data to search for the formula (assume I don't cheat by googling)
For sum(x^2 - 3*x), formula should be a cubic, with no constant term (sum=0 when n=0)

Try:
n = 1, sum = (1^2 - 3) = -2
n = 2, sum = -2 + (2^2 - 3*2) = -4
n = 3, sum = -4 + (3^2 - 3*3) = -4

3 equations, 3 unknowns (cubic coefficients), we get sum = n^3/3 - n^2 - 4/3*n

So, for n = 100, sum = n/3 * (n^2 - 3*n - 4) = 100/3 * 9696 = 323200

You might be interested in Newton's Forward Difference Formula:

I could never remember Forward Difference formula, without looking up.
Instead, I use the Lagrange formula, which work for uneven intervals too.

The formula look complicated, but it is very mechanical, easy to remember.
Fitting a cubic sum = n * quadratic,

sum / n
= (-2/1) $$(n-2)(n-3)\over(1-2)(1-3)$$ + (-4/2) $$(n-1)(n-3)\over(2-1)(2-3)$$ + (-4/3) $$(n-1)(n-2)\over(3-1)(3-2)$$
= -(n-2)(n-3) + 2(n-1)(n-3) - (2/3)(n-1)(n-2)
= (-n^2 + 5 n - 6) + (2 n^2 - 8 n + 6) + (-2/3 n^2 + 2 n - 4/3)
= n^2/3 - n - 4/3

sum = n * (n^2/3 - n - 4/3) = n/3 * (n^2 - 3 n - 4) = n(n+1)(n-4) / 3

Edit: Forward Difference Formula is very neat, without even evaluate sums.
 « Next Oldest | Next Newest »

 Messages In This Thread Summation on HP 42S - lrdheat - 09-23-2018, 06:14 PM RE: Summation on HP 42S - Didier Lachieze - 09-23-2018, 06:28 PM RE: Summation on HP 42S - lrdheat - 09-23-2018, 06:41 PM RE: Summation on HP 42S - lrdheat - 09-23-2018, 06:51 PM RE: Summation on HP 42S - ijabbott - 09-23-2018, 07:40 PM RE: Summation on HP 42S - burkhard - 09-25-2018, 12:58 PM RE: Summation on HP 42S - John Keith - 09-25-2018, 04:15 PM RE: Summation on HP 42S - Thomas Klemm - 09-23-2018, 08:29 PM RE: Summation on HP 42S - lrdheat - 09-23-2018, 09:25 PM RE: Summation on HP 42S - Didier Lachieze - 09-23-2018, 10:03 PM RE: Summation on HP 42S - lrdheat - 09-23-2018, 10:02 PM RE: Summation on HP 42S - lrdheat - 09-23-2018, 10:37 PM RE: Summation on HP 42S - Thomas Klemm - 09-24-2018, 12:56 AM RE: Summation on HP 42S - Albert Chan - 09-24-2018, 11:56 AM RE: Summation on HP 42S - Thomas Klemm - 09-24-2018, 01:17 AM RE: Summation on HP 42S - Thomas Klemm - 09-24-2018, 01:52 PM RE: Summation on HP 42S - Albert Chan - 09-24-2018 04:20 PM RE: Summation on HP 42S - pier4r - 09-24-2018, 01:55 PM RE: Summation on HP 42S - Frido Bohn - 09-25-2018, 01:59 PM RE: Summation on HP 42S - Dieter - 09-25-2018, 04:47 PM RE: Summation on HP 42S - Frido Bohn - 09-26-2018, 10:10 AM RE: Summation on HP 42S - Albert Chan - 09-26-2018, 03:13 PM RE: Summation on HP 42S - Albert Chan - 09-25-2018, 05:28 PM RE: Summation on HP 42S - lrdheat - 09-25-2018, 05:17 PM RE: Summation on HP 42S - lrdheat - 09-25-2018, 05:28 PM RE: Summation on HP 42S - Albert Chan - 09-25-2018, 07:17 PM RE: Summation on HP 42S - Valentin Albillo - 09-25-2018, 08:01 PM RE: Summation on HP 42S - Albert Chan - 09-25-2018, 08:59 PM RE: Summation on HP 42S - Gerson W. Barbosa - 09-26-2018, 12:36 PM RE: Summation on HP 42S - Albert Chan - 09-26-2018, 01:23 PM RE: Summation on HP 42S - Gerson W. Barbosa - 09-26-2018, 01:54 PM RE: Summation on HP 42S - pier4r - 09-26-2018, 04:09 PM RE: Summation on HP 42S - Thomas Klemm - 09-27-2018, 03:47 AM RE: Summation on HP 42S - Ángel Martin - 09-27-2018, 05:27 AM RE: Summation on HP 42S - pier4r - 09-27-2018, 10:37 PM RE: Summation on HP 42S - Thomas Okken - 09-28-2018, 12:33 AM RE: Summation on HP 42S - pier4r - 09-28-2018, 01:40 PM RE: Summation on HP 42S - ijabbott - 09-28-2018, 11:20 PM RE: Summation on HP 42S - Albert Chan - 09-29-2018, 12:51 AM RE: Summation on HP 42S - Valentin Albillo - 09-29-2018, 01:15 AM RE: Summation on HP 42S - Thomas Okken - 09-29-2018, 01:24 AM RE: Summation on HP 42S - ijabbott - 09-29-2018, 11:58 AM RE: Summation on HP 42S - Albert Chan - 09-29-2018, 12:49 PM RE: Summation on HP 42S - Thomas Okken - 09-29-2018, 01:50 PM RE: Summation on HP 42S - ijabbott - 09-29-2018, 04:06 PM RE: Summation on HP 42S - Thomas Okken - 09-29-2018, 06:15 PM RE: Summation on HP 42S - ijabbott - 09-29-2018, 09:10 PM RE: Summation on HP 42S - Thomas Okken - 09-29-2018, 09:33 PM RE: Summation on HP 42S - Albert Chan - 09-30-2018, 03:03 PM RE: Summation on HP 42S - ijabbott - 09-30-2018, 05:28 PM RE: Summation on HP 42S - brickviking - 10-01-2018, 08:40 AM RE: Summation on HP 42S - pier4r - 09-29-2018, 05:59 PM RE: Summation on HP 42S - Thomas Okken - 09-29-2018, 08:59 PM

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