Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Bernoulli-numbers/Mathematica/bernoulli-numbers-1.math
Normal file
11
Task/Bernoulli-numbers/Mathematica/bernoulli-numbers-1.math
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
bernoulli[n_] := Module[{a = ConstantArray[0, n + 2]},
|
||||
Do[
|
||||
a[[m]] = 1/m;
|
||||
If[m == 1 && a[[1]] != 0, Print[{m - 1, a[[1]]}]];
|
||||
Do[
|
||||
a[[j - 1]] = (j - 1)*(a[[j - 1]] - a[[j]]);
|
||||
If[j == 2 && a[[1]] != 0, Print[{m - 1, a[[1]]}]];
|
||||
, {j, m, 2, -1}];
|
||||
, {m, 1, n + 1}];
|
||||
]
|
||||
bernoulli[60]
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
Table[{i, BernoulliB[i]}, {i, 0, 60}];
|
||||
Select[%, #[[2]] != 0 &] // TableForm
|
||||
Loading…
Add table
Add a link
Reference in a new issue