To where the sum $\sum_{n=2}^N \frac{a^n}{n!}$ converges?

76 Views Asked by At

I'm trying to implement this expression in an algorithm, however computing factorial is very time-consuming, so I'm trying to find an equivalent equation that avoids that factorial term.

It can be an approximation too.

Thank you very much if you have any ideas

BR

3

There are 3 best solutions below

0
On BEST ANSWER

If you want to be strict $$\sum_{n=2}^m \frac{a^n}{n!}=e^a\frac{ \Gamma (m+1,a)}{\Gamma (m+1)}-a-1$$ Now, if you want an approximation of the "bad" term $$\frac{\Gamma (m+1,a)}{\Gamma (m+1)}\approx 1-\frac{a^{m+1} e^{m (1-\log (m))-a}}{\sqrt{2 \pi }\, m^{3/2}}$$ Trying with $a=\pi$ and $m=10$, the "exact" value of the above is $0.99957$ while the approximation would give $0.99965$.

Using the approximation, then $$\sum_{n=2}^m \frac{a^n}{n!}\approx (e^a-a-1)-\frac{a^{m+1} e^{m (1-\log (m))}}{\sqrt{2 \pi }\, m^{3/2}}$$

Edit

If you want better, you could use $$\frac{\Gamma (m+1,a)}{\Gamma (m+1)}\approx 1-\frac{a^{m+1} e^{m (1-\log (m))-a}}{\sqrt{2 \pi }\, m^{3/2}}\left(1+\frac{12 a-13}{12 m} \right)$$ which, for the este case, would give $0.9995740$ while the exact value is $0.9995723$. Big improvement for a very small correction.

4
On

We have $\sum_{n=2}^N \frac{a^n}{n!}=\sum_{n=0}^N \frac{a^n}{n!}-1-a$ and $\sum_{n=0}^N \frac{a^n}{n!} \to e^a$ as $N \to \infty.$

Thus

$$\sum_{n=2}^N \frac{a^n}{n!} \to e^a -1-a$$

as $N \to \infty.$

I hope , that it helps.

2
On
s:= 0
p:= a² / 2
n:= 3
while s + p != s:
    s:= s + p
    p:= a . p / n
    n:= n + 1

(adjust the termination criterion if you want a finite number of terms).