top of page

e adventure

Calculating e from \sum (1/factorial(n))

8132 terms of gives 2.7182818284590455

4 terms of gives 2.708333333333333

117 terms of gives 2.7182818284590455

12 terms of gives 2.7182818282861687

220 terms of gives 2.7182818284590455

1699 terms of gives 2.7182818284590455

6962 terms of gives 2.7182818284590455

97 terms of gives 2.7182818284590455

4519 terms of gives 2.7182818284590455

1207 terms of gives 2.7182818284590455


import math

N=10000

import random

print('Calculating e from \sum (1/factorial(n)')

for j in range(10):

N=int((10**4)**random.random())

s=1.0

import numpy as np

for i in range(1,N):

s=s+1/math.factorial(i)

print(N-1,'terms of gives ', s)

1 view1 comment

Recent Posts

See All

Helio Centric Model

We see high resolution snapshots of earth proving earth is spherical. However to prove helio centgricity we must take angles of planets and make some transforms whether on a satellite telescope or ear

Engtangled an normal states

Here are entangled states ( {(1.1|0> +8.6|1> +4.2|2> +7.7|3> +8.6|4> +5.3|5> +9.8|6> +3.9|7> +1.4|8> ) /19.2}{(7.7|0> +4.8|1> +5.9|2> +5.0|3> +0.9|4> +5.0|5> +6.4|6> +8.0|7> +0.1|8> +3.1|9> ) /16.8})+

Pi adventure

Calculating pi from atan(1)=pi/4 s=s+4*(-1)**(i+1)/(2*i-1) 2526 terms of gives 3.141196770786618 323 terms of gives 3.1446886214033025 452 terms of gives 3.1393802669164748 111 terms of gives 3.150601

bottom of page