Apéry's constant: Difference between revisions
→{{header|Mathematica}}/{{header|Wolfram Language}}: Add newline in Print
(Add Mathematica/Wolfram Language implementation) |
(→{{header|Mathematica}}/{{header|Wolfram Language}}: Add newline in Print) |
||
Line 140:
ClearAll["Global`*"];
TruancateTo100DecimalDigits = N[#, 100 + 1] &;
MyShowApéryConstant[expr_, caption_String] :=
Print[caption <>
MyShowApéryConstant[
Zeta[3], "Apéry's constant via Mathematica's Zeta:\n"]
MyShowApéryConstant[
Sum[1/(k^3), {k, 1,
1000}], "Apéry's constant via reciprocal cubes:\n"]
MyShowApéryConstant[(5/2*
Sum[(-1)^(k - 1)*(k!)^2/((2 k)!*k^3), {k, 1,
158}]), "Apéry's constant via Markov's summation:\n"]
MyShowApéryConstant[
1/24*Sum[(-1)^
Line 154 ⟶ 156:
531578 k^3 + 336367 k^2 + 104000 k +
12463)/(((3 k + 2)!)*((4 k + 3)!)^3), {k, 0,
19}], "Apéry's constant via Wedeniwski's summation:\n"]
</syntaxhighlight>
{{out}}
Line 167 ⟶ 169:
1.2020569031595942853997381615114499907649862923404988817922715553418382057863130901864558736093352581
</pre>
=={{header|Nim}}==
|