97 votes
Accepted

Bake a slice of Pi

MATL, 70 68 67 bytes '()'12:)l10:&<toYP43Y$51hb(!10Xy'\::\'FFhZ++'|'3$Yc'||\'3:(95'Zd'o( Try it online! Explanation What a mess. But hey, there's a ...
Luis Mendo's user avatar
  • 104k
39 votes

Bake a slice of Pi

Perl, 93 bytes $_=bpi$=;printf'()'x6x!$`.' %12s',F.ee x!$\--^substr"\32::\\$&|",-12while/.{$\}/g Requires the command line option ...
primo's user avatar
  • 33.3k
24 votes

Bake a slice of Pi

JavaScript (ES6), 187 174 bytes This is 1 byte shorter than just displaying the plain text. ...
Arnauld's user avatar
  • 192k
22 votes
Accepted

Find the nth decimal of pi

05AB1E, 3 bytes žs¤ Explained žs # push pi to N digits ¤ # get last digit Try it online Uses 1-based indexing. Supports ...
Emigna's user avatar
  • 53k
22 votes

Pi got your number

Python 2, 69 75 71 67 bytes Saved 4 bytes due to caird coinheringaahing. x=p=1333 while~-p:x=p/2*x/p+2*10**200;p-=2 print`x`.find(input(),1) Not finding ...
primo's user avatar
  • 33.3k
21 votes

Sort digits by their first occurrence in pi

Python 3, 40 39 bytes 1 byte thanks to Jonathan Allan. lambda s:sorted(s,key="145926870".find) Try it online!
Leaky Nun's user avatar
  • 49.7k
20 votes

Find Primes in Pi

05AB1E,  10  8 bytes -2 bytes thanks to Adnan (p vectorises) <žsþŒÙpO Try it online! (will work up to n=98413 ...
Jonathan Allan's user avatar
19 votes

Happy Rounded Pi Day

C, 32 bytes #define f(d)d*time(0)/464083315. If losing a little more accuracy is fine, I can get it down to about 29 bytes being still accurate to 4 digits past ...
Josh's user avatar
  • 2,771
19 votes

Pi got your number

Husk, 5 bytes €tİπd Try it online! Explanation ...
Fyr's user avatar
  • 621
19 votes

Pi to the power y, for small y's

APL (Dyalog Extended), 9 8 bytesSBCS (⍳12)√○1 Try it online! (⎕PP←34 is Print Precision: 34 digits; ...
Adám's user avatar
  • 30.2k
19 votes

Pi to the power y, for small y's

JavaScript (ES7), 121 bytes Computes as many digits as the precision of IEEE 754 allows and hardcodes the other ones. ...
Arnauld's user avatar
  • 192k
18 votes

Find the nth decimal of pi

Python 2, 66 bytes n=input()+9 x=p=5L**7 while~-p:x=p/2*x/p+10**n;p-=2 print`x/5`[-9] Input is taken from stdin. Sample Usage ...
primo's user avatar
  • 33.3k
18 votes

Pi got your number

Excel, 212 bytes ...
Engineer Toast's user avatar
17 votes

Bake a slice of Pi

///, 129 127 bytes ...
Erik the Outgolfer's user avatar
17 votes

Bake a slice of Pi

Python 2, 131 bytes print'()'*6+'\n|\\3.1415926|\n|:\\53589793|' for n in 2384626,433832,79502,8841,971,69,3,'':print'%11s|'%('\%s'*2%('_:'[n<'']*2,n)) Joint ...
Lynn's user avatar
  • 68.7k
17 votes

Sort digits by their first occurrence in pi

05AB1E, 10 9 7 bytes Saved 1 byte thanks to Leaky Nun noting that filtering out duplicates is unnecessary. Saved 2 bytes thanks to Adnan. žqRvy†J Try it online! ...
Emigna's user avatar
  • 53k
15 votes

Pi to the power y, for small y's

Bash + bc + coreutils, 51, 40, 39, 36 bytes following @ChristianSievers comment |cut -c -21 could be removed. -3 bytes thanks to @DigitalTrauma. ...
Nahuel Fouilleul's user avatar
15 votes

Pi to the power y, for small y's

Julia 1.0, 18 bytes @.π^(1/big(1:12)) Try it online! (1./big(1:12)) divides a BigInt 1 ...
gggg's user avatar
  • 2,005
14 votes

Happy Rounded Pi Day

AppleScript, 122 120 bytes set a to current date (display dialog""default answer"")'s text returned*(month of a+day of a*.01+year of a*1e-4 mod.01) Variable a ...
Addison Crump's user avatar
14 votes
Accepted

Sort digits by their first occurrence in pi

Pyth, 8 6 bytes ox+.n0 Try it here. -1 thanks to Leaky Nun: The input will provide the 0 if it's ever needed. Trivial -1 thanks ...
Erik the Outgolfer's user avatar
14 votes

Output first \$n\$ digits of \$\pi^{1/\pi}\$

Python, 149 bytes Saved one byte due to @H.PWiz. ...
primo's user avatar
  • 33.3k
13 votes

Happy Rounded Pi Day

Mathematica + coreutils, 20 bytes <<"!date +%m.%d%y"#& Luckily, Mathematica interprets the output of an external command as an expression. In this case ...
murphy's user avatar
  • 655
12 votes

Happy Rounded Pi Day

Lua, 30 27 Bytes print(...*os.date"%m.%d%y") Multiply the first command-line argument by the current date in format ...
Katenkyo's user avatar
  • 3,085
12 votes

Bake a slice of Pi

Bash, 153 bytes ...
Chris's user avatar
  • 161
12 votes

Natural Pi #0 - Rock

APL, 23 bytes {.5*⍨6×⍵÷1+.=∨/?⍵2⍴1e6} Explanation: ?⍵2⍴1e6: generate a 2-by-⍵ matrix of random numbers in the range [1..106] ...
marinus's user avatar
  • 31.2k
12 votes

Mix pi and e to make pie!

Mathematica, 50 bytes 1-indexed (Riffle@@(#&@@RealDigits[#,10,5!]&/@{Pi,E}))[[#]]&
ZaMoC's user avatar
  • 24.9k
12 votes

Elastic collisions between blocks

APL (Dyalog Classic), 18 16 bytes ¯1+⌈○÷¯3○.5*⍨⎕÷⎕ Try it online! rendered as the equivalent {¯1+⌈○÷¯3○.5*⍨⍵÷⍺} in the tio ...
ngn's user avatar
  • 15.3k
12 votes

Find a sequence in the binary digits of π

JavaScript (Node.js),  167  165 bytes This is long and slow ... but it should work for any input in theory. ...
Arnauld's user avatar
  • 192k
11 votes

Find the nth decimal of pi

Bash + coreutils, 60 49 bytes echo "scale=10100;4*a(1)"|bc -l|tr -d '\\\n'|cut -c$(($1+2)) ...
Marco's user avatar
  • 591
11 votes

Find the nth decimal of pi

Python 2, 73 71 73 bytes thanks to @aditsu for increasing my score by 2 bytes Finally an algorithm that can complete under 2 seconds. ...
Leaky Nun's user avatar
  • 49.7k

Only top scored, non community-wiki answers of a minimum length are eligible