Search Results

Results tagged with Search options answers only user 48934
5 results

This challenge involves the mathematical constant pi.

Python 3, 40 39 bytes 1 byte thanks to Jonathan Allan. lambda s:sorted(s,key="145926870".find) Try it online!
answered Apr 29 '17 by Leaky Nun
Python 3 + sympy, 144 bytes from sympy import* def f(n,p): R="";O=n and int(log(n,pi));r=pi**O for _ in range(O+p):R+=str(int(n/r));n%=r;r/=pi return R[:O+1]+"."+R[O+1:] Try it online! Quite slow, actually. …
answered Apr 6 '18 by Leaky Nun
Python 3, 64 bytes print("3.%d"%int("SIXW57LUPVBUA10HBQJOL57QLF54UT0U00KIN32O",36)) Try it online!
answered Sep 15 '17 by Leaky Nun
Python 3, 471 317 310 bytes 7 bytes thanks to caird coinheringaahing. Surely there are golfs that I missed. Feel free to point them out in the comments. def h(Q): a=0;C=b=4;c=d=s=1;P=o=3 while …
answered Apr 6 '18 by Leaky Nun
lambda n:p[n+1] Ideone it! Uses the formula pi = 4*arctan(1) while computing arctan(1) using its taylor series. …
answered Jul 4 '16 by Leaky Nun