Bernoulli numbers: Difference between revisions

Changed a[j-1] - a[j] to a[j] - a[j-1] to get the right value for B1 (-1/2).
m (Corrected typo.)
(Changed a[j-1] - a[j] to a[j] - a[j-1] to get the right value for B1 (-1/2).)
Line 2,418:
a[m] = newRat(1, m + 1)
for j in countdown(m, 1):
a[j-1] = j * (a[j-1] - a[j-1])
result = a[0]
 
Line 2,449:
{{out}}
<pre> 0: 1 / 1
1: -1 / 2
2: 1 / 6
4: -1 / 30
Anonymous user