Skip to content

Instantly share code, notes, and snippets.

View RezaT4795's full-sized avatar

Reza Talebi RezaT4795

View GitHub Profile
@RezaT4795
RezaT4795 / first 10-digit prime found in consecutive digits of e
Last active August 16, 2017 16:43 — forked from tuxskar/first 10-digit prime found in consecutive digits of e
Puzzle "first 10-digit prime found in consecutive digits of e"
import math
def get_e():
from decimal import Decimal, getcontext
getcontext().prec = 200 # improve precision
e, f, n = Decimal(0), Decimal(1), Decimal(1)
while True:
old_e = e
e += Decimal(1) / f