Talk:Bernoulli numbers: Difference between revisions
→B(1)?: new section
(added a discussion page.) |
(→B(1)?: new section) |
||
(13 intermediate revisions by 2 users not shown) | |||
Line 1:
__TOC__
I added the Bernoulli numbers task for serveral reasons:▼
== Bernoulli numbers, the ''why'' and the ''why for'' ==
::* they're an important sequence
Line 7 ⟶ 9:
The numerator can get quite large. Here is a list of the non-zero Bernoulli numbers from '''B'''<sub>0</sub> to '''B'''<sub>200</sub>:
<pre>▼
(Shown at four-fifth size.)
B(n) Bernoulii number expressed as a fraction▼
<pre style="font-size:80%">
▲B(n) Bernoulli number expressed as a fraction
──── ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
0 1/1
Line 113 ⟶ 118:
200 -498384049428333414764928632140399662108495887457206674968055822617263669621523687568865802302210999132601412697613279391058654527145340515840099290478026350382802884371712359337984274122861159800280019110197888555893671151/1366530
</pre>
-- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 09:04, 11 March 2014 (UTC)
-----
==Algorithm?==
How about adding info on how to generate the numbers to the task description? --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 13:47, 11 March 2014 (UTC)
: I didn't want to suggest or demand any particular method on how to generate Bernoulli numbers. People are free to use any method they want. The link to the ''Wolfram MathWorld (TM)'' has some examples, the REXX example uses formula 33. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 16:11, 11 March 2014 (UTC)
:: I just copied the Wikipedia algo. (with <strike>atribution</strike> attribution). People don't have to use it, but they don't have to search for at least one algo. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 01:20, 12 March 2014 (UTC)
::: Yes, it sure ''looks'' simple. The programming solutions that used it also looks simple and clean. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 01:56, 12 March 2014 (UTC)
-----
The double sum formula used by the REXX example is #33 from the entry [http://mathworld.wolfram.com/BernoulliNumber.html Bernoulli number] on The Eric Weisstein's World of Mathematics (TM).
<br><br>
::::::: <math> B_n = \sum_{k=0}^n \frac{1}{k+1} \sum_{r=0}^k (-1)^r \binom kr r^n </math>
<br>
:::::::::::::: where <math> \binom kr</math> is a binomial coefficient.<br>
<br> -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 01:00, 18 March 2014 (UTC)
==use of memoization==
In the REXX programming solution, I added memoization for the COMB and PERM functions (combinations and permutations).
▲<pre>
For computing the Bernoulli numbers up to (and including):
50 values, memoization was 17% faster.
100 " " " 38% "
200 " " " 42% "
</pre>
== B(1)? ==
I propose to leave the choice of B(1)=1/2 or B(1)=-1/2 open to solution authors. It's essentially arbitrary anyway, and the solutions already provided are split. I see no reason to prescribe one over the other. [[User:Thebigh|Thebigh]] ([[User talk:Thebigh|talk]]) 13:39, 27 October 2021 (UTC)
|