Python 2, 98 100 72, 71 bytes
f=lambda n,p=1,q=1,k=1:k<n+9and f(n,p*k+1,q*k,k+1)or str(p*100**n/q)[n]
Try it online!
-1 byte, remove unneccesary whitespace.
older answer
f=lambda n,p=1,q=1,k=1:k<n+9and f(n,p*k+1,q*k,k+1) or str(p*100**n/q)[n]
Try it online!
-28 bytes simpler formula
Simpler algorithm based on more usual formula:
$$e = 1 + \frac 1 {1!} + \frac 1 {2!} + \frac 1 {3!} + \frac 1 {4!} + \cdots$$
But re-expressed as sequence of approximations:
$$1, 1+1, \frac{(2(1+1)+1)}2, \frac{(3(2(1+1)+1)+1)}{(3\cdot2)}, \frac{(4(3(2(1+1)+1)+1)+1)}{(4\cdot(3\cdot2))},...$$
These can be expressed as ratio of recurrence relations $\frac {p_k}, where
$$p_0 = q_0 = 1 \\
p_{k+1} = kp_k + 1, q_{k+1} = kq_k, \: \forall k \ge 1$$
old answer
f=lambda n,p=3,q=1,r=19,s=7,b=10,x=1,y=0:x-y and f(n,r,s,r*b+p,s*b+q,b+4,p*100**n//q,x) or str(x)[n]
+2 bytes because I mistakenly omitted f=
Try it online!
This approach is based on continued fractions. Not happy with it yet, but it seems good for a few hundred digits.
Based on the continued fraction:
$$e = 3 - \cfrac 2 {7 + \cfrac 1 {10 + \cfrac 1 {14 + \cfrac 1 {18 + \cfrac 1 {22 + \ddots}}}}}$$
Computed by the recurrence relation:
$$\frac {p_0} {q_0} = \frac 3 1 , \: \frac {p_1} {q_1} = \frac {19} 7 \\
\frac {p_{k+1}} {q_{k+1}} = \frac {p_k (4k+2) + p_{k-1}} {q_k (4k+2) + q_{k-1}}, \: \forall k \ge 1$$
which was arrived at after a first reading of An Essay on Continued Fractions by Leonard Euler.
n
-th digit, because it may have been rounded up. For example,e
with 4-decimal precision would give you2.7183
, but actually the 4-th decimal is2
, not3
\$\endgroup\$