# Revision history [back]

In sage i tried to work in the following numerical field R:

R = RealField(200)
R(pi)

N = 10000
S1 = sum( [ R( (n/exp(1))^n / factorial(n) ) for n in [1..N] ] )
S2 = 1/sqrt(2*R(pi)) * sum( [ R( 1/sqrt(n) ) for n in [1..N] ] )
S1 - S2


After a while:

3.1415926535897932384626433832795028841971693993751058209749
-0.083404622472617419033475969548978763069063830480341659271178


Two decimals only, this is because we have a slow convergence.

In pari/gp:

? \p 200
realprecision = 211 significant digits (200 digits displayed)
?
? N = 20000
%1 = 20000
? S1 = sum( n=1, N, (n/exp(1))^n / n! )
%2 = 112.17313066274937979489499417935379308757523535794874273299297201896403797332045063551083264178584322111389066602610107202478259077132712353378611733460800239174023186964221827251175464458573129824452
? S2 = 1/sqrt(2*Pi) * sum( n=1, N, 1./sqrt(n) )
%3 = 112.25673001969414128242389934033133492400419727408188161493507054932051390461929936662048861000846610281386339772874414970984758369589845752424666439767258043083118243285029238837805841560457193884550
? S1 - S2
%4 = -0.083599356944761487528905160977541836428961916133138881942098530356475931298848731109655968222622881699972731702643077685064992924571333990460547063064578039090950563208074115866303771018840640600982726
?