Skip to content

Instantly share code, notes, and snippets.

@chemacortes
Created January 2, 2016 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chemacortes/5ff8e4ec7b271d547458 to your computer and use it in GitHub Desktop.
Save chemacortes/5ff8e4ec7b271d547458 to your computer and use it in GitHub Desktop.
print (lambda p:p[0]+'.'+p[1:])(
str((lambda(x,y,t,a):2L*x*x//a)(
(lambda F:(lambda S:reduce(
lambda(x,y,t,a),_:((x+y)//2L,
S((x*y)//F),2L*t,
(a-(t*(((x+y)//2L)**2-
(S((x*y)//F))**2))//F)),
[0]*13,(F,(F*F)//S(2L*F),2L,F//2L)))(
lambda n:reduce(lambda x,_:(
x-x//2L+(n*F)//(2L*x)),
[0]*15,
n//2L)))(10L**(5010))))[:5000])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment