32 lines
2.2 KiB
Text
32 lines
2.2 KiB
Text
[[wp:Bernoulli number|Bernoulli numbers]] are used in some series expansions of several functions (trigonometric, hyperbolic, gamma, etc.), and are extremely important in number theory and analysis.
|
||
|
||
Note that there are two definitions of Bernoulli numbers; this task will be using the modern usage (as per ''The National Institute of Standards and Technology convention'').
|
||
|
||
The n<sup>th</sup> Bernoulli number is expressed as '''B'''<sub>n</sub>.
|
||
<br>
|
||
|
||
;Task
|
||
|
||
:* show the Bernoulli numbers '''B'''<sub>0</sub> through '''B'''<sub>60</sub>.
|
||
:* suppress the output of values which are equal to zero. (Other than '''B'''<sub>1</sub> , all ''odd'' Bernoulli numbers have a value of zero.)
|
||
:* express the Bernoulli numbers as fractions (most are improper fractions).
|
||
:* the fractions should be reduced.
|
||
:* index each number in some way so that it can be discerned which Bernoulli number is being displayed.
|
||
:* align the solidi (<big><b>/</b></big>) if used (extra credit).
|
||
|
||
|
||
;An algorithm
|
||
The Akiyama–Tanigawa algorithm for the "second Bernoulli numbers" as taken from [[wp:Bernoulli_number#Algorithmic_description|wikipedia]] is as follows:
|
||
|
||
'''for''' ''m'' '''from''' 0 '''by''' 1 '''to''' ''n'' '''do'''
|
||
''A''[''m''] ← 1/(''m''+1)
|
||
'''for''' ''j'' '''from''' ''m'' '''by''' -1 '''to''' 1 '''do'''
|
||
''A''[''j''-1] ← ''j''×(''A''[''j''-1] - ''A''[''j''])
|
||
'''return''' ''A''[0] (which is ''B''<sub>''n''</sub>)
|
||
|
||
;See also
|
||
* Sequence [[oeis:A027641|A027641 Numerator of Bernoulli number B_n]] on The On-Line Encyclopedia of Integer Sequences.
|
||
* Sequence [[oeis:A027642|A027642 Denominator of Bernoulli number B_n]] on The On-Line Encyclopedia of Integer Sequences.
|
||
* Entry [http://mathworld.wolfram.com/BernoulliNumber.html Bernoulli number] on The Eric Weisstein's World of Mathematics (TM).
|
||
* Luschny's [http://luschny.de/math/zeta/The-Bernoulli-Manifesto.html The Bernoulli Manifesto] for a discussion on <big> '''B<sub>1</sub> = -½''' versus '''+½'''. </big>
|
||
<br><br>
|