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