I'm working a problem in Project Euler that asks to find the value of a continuous fraction representing e (the mathematical constant) up to 100 terms.
I came up with a long expression which I'm almost positive is correct but Python can't evaluate it. I keep getting a MemoryError.
To put it in perspective, it's a fraction with 50 fraction bars in it.
Here's the expression:
2+(1/(1+1/(2+1/(1+1/(1+1/(4+1/(1+1/(1+1/(6+1/(1+1/(1+1/(8+1/(1+1/(1+1/(10+1/(1+1/(1+1/(12+1/(1+1/(1+1/(14+1/(1+1/(1+1/(16+1/(1+1/(1+1/(18+1/(1+1/(1+1/(20+1/(1+1/(1+1/(22+1/(1+1/(1+1/(24+1/(1+1/(1+1/(26+1/(1+1/(1+1/(28+1/(1+1/(1+1/(30+1/(1+1/(1+1/(32+1/(1+1/(1+1/(34+1/(1+1/(1+1/(36+1/(1+1/(1+1/(38+1/(1+1/(1+1/(40+1/(1+1/(1+1/(42+1/(1+1/(1+1/(44+1/(1+1/(1+1/(46+1/(1+1/(1+1/(48+1/(1+1/(1+1/(50+1/(1+1/(1+1/(52+1/(1+1/(1+1/(54+1/(1+1/(1+1/(56+1/(1+1/(1+1/(58+1/(1+1/(1+1/(60+1/(1+1/(1+1/(62+1/(1+1/(1+1/(64+1/(1+1/(1+1/(66+1/(1+1))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
The answer should be very close to e (2.71828)