Post Reply 
(12C+) Bernoulli Number
07-28-2019, 11:21 AM (This post was last modified: 07-18-2023 12:09 AM by John Keith.)
Post: #8
RE: (12C+) Bernoulli Number
(07-28-2019 12:02 AM)Albert Chan Wrote:  I lookup "A Source Book in Mathematics", chapter "On the Bernoulli numbers":

B(n) is just sum of k^n formula linear term coefficient.

Example, this is how B(6) is calculated, by doing k^6 forward difference
(see thread: https://www.hpmuseum.org/forum/thread-12...#pid110972)

1 64 729 4096 15625 46656 117649 // value of 1^6 to 7^6
63 665 3367 11529 31031 70993     // forward differences
602 2702 8162 19502 39962
2100 5460 11340 20460
3360 5880 9120
2520 3240
720

Sum of k^6 formula = \(1\binom{n}{1}+63\binom{n}{2}+602\binom{n}{3}+2100\binom{n}{4}+3360\binom{n}{5}​+2520\binom{n}{6}+720\binom{n}{7}\)

B(6) = Linear term coefficient = 1/1 - 63/2 + 602/3 - 2100/4 + 3360/5 - 2520/6 + 720/7 = 1/42

That is a very neat method, I was not aware of that one. However, it seems that all similar exact methods require n+(n-1) storage registers to calculate B(n) since one needs to keep the (n-1)th row of the difference table in memory while calculating the nth row.

EDIT: I tried your program as well as the Akiyama-Tanigawa method as used in the third program here on the HP-48G and both methods fail due to catastrophic rounding error for n>10. These methods may only be practical for languages that use exact rational arithmetic.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C+) Bernoulli Number - Gamo - 07-27-2019, 06:41 AM
RE: (12C+) Bernoulli Number - Albert Chan - 07-27-2019, 12:41 PM
RE: (12C+) Bernoulli Number - Gamo - 07-27-2019, 01:40 PM
RE: (12C+) Bernoulli Number - John Keith - 07-27-2019, 07:49 PM
RE: (12C+) Bernoulli Number - Albert Chan - 07-28-2019, 12:02 AM
RE: (12C+) Bernoulli Number - John Keith - 07-28-2019 11:21 AM
RE: (12C+) Bernoulli Number - Albert Chan - 08-30-2023, 09:46 PM
RE: (12C+) Bernoulli Number - Albert Chan - 09-11-2023, 03:48 PM
RE: (12C+) Bernoulli Number - Albert Chan - 07-28-2019, 01:08 AM
RE: (12C+) Bernoulli Number - Gamo - 07-28-2019, 02:29 AM
RE: (12C+) Bernoulli Number - Albert Chan - 07-31-2019, 05:14 PM
RE: (12C+) Bernoulli Number - Albert Chan - 09-12-2023, 05:59 PM



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