Apéry's constant: Difference between revisions

Add Mathematica/Wolfram Language implementation
m (→‎{{header|Wren}}: Changed to Wren S/H)
(Add Mathematica/Wolfram Language implementation)
Line 135:
1.2020569031595942853997381615114499907649862923404988817922715553418382057863130901864558736093352581
</pre>
 
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<syntaxhighlight lang="Mathematica">
ClearAll["Global`*"];
TruancateTo100DecimalDigits = N[#, 100 + 1] &;
MyShowApéryConstant[expr_, caption_String] := Print[caption <> \
ToString@Activate@TruancateTo100DecimalDigits[expr]];
MyShowApéryConstant[
Zeta[3], "Apéry's constant via Mathematica's Zeta:"]
MyShowApéryConstant[
Sum[1/(k^3), {k, 1, 1000}], "Apéry's constant via reciprocal cubes:"]
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:"]
MyShowApéryConstant[
1/24*Sum[(-1)^
k*((2 k + 1)!)^3*((2 k)!)^3*(k!)^3*(126392 k^5 + 412708 k^4 +
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:"]
</syntaxhighlight>
{{out}}
<pre>
Apéry's constant via Mathematica's Zeta:
1.2020569031595942853997381615114499907649862923404988817922715553418382057863130901864558736093352581
Apéry's constant via reciprocal cubes:
1.2020564036593442854830714115115999903483212709031775135036540966118572571921400836130084123260473112
Apéry's constant via Markov's summation:
1.2020569031595942853997381615114499907649862923404988817922715553418382057863130901864558736093352581
Apéry's constant via Wedeniwski's summation:
1.2020569031595942853997381615114499907649862923404988817922715553418382057863130901864558736093352581
</pre>
 
 
=={{header|Nim}}==
337

edits