Summation on HP 42S
|
09-24-2018, 01:52 PM
Post: #14
|
|||
|
|||
RE: Summation on HP 42S
(09-24-2018 11:56 AM)Albert Chan Wrote: This almost look like integration ! Just have a look at the definition of Pascal's triangle: \({n \choose k}={n-1 \choose k-1}+{n-1 \choose k}\) Or then just check the diagonals. E.g. for \(k=2\) the partial sum of the first elements is just below on the next line: 1 = 1 1 + 3 = 4 1 + 3 + 6 = 10 1 + 3 + 6 + 10 = 20 1 + 3 + 6 + 10 + 15 = 35 … Quote:I normally just fit the data to search for the formula (assume I don't cheat by googling) You might be interested in Newton's Forward Difference Formula: \(f(x+a)=\sum_{n=0}^\infty{a \choose n}\Delta^nf(x)\) Quote:the formula looks suspiciously like a finite analog of a Taylor series expansion So for the given example we get: x: 0 1 2 3 … f: 0 -2 -4 -4 … ∆f: -2 -2 0 … ∆²f: 0 2 … ∆³f: 2 … And so with \(x=0\) we end up with: \(f(a)=2{a \choose 3} - 2{a \choose 1}\) This leads to an even shorter program: Code: 00 { 11-Byte Prgm } Conclusion: We don't really have to solve the linear system of equations. Kind regards Thomas We don't even have to calculate the sum f but can only calculate ∆f: x: 0 1 2 3 … f: 0 … ∆f: -2 -2 0 … ∆²f: 0 2 … ∆³f: 2 … |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)