For π Day. 2015, WRI stirred up publicity with https://blog.stephenwolfram.com/2015/03/pi-or-pie-celebrating-pi-day-of-the-... Off-list I grumbled that no self-respecting Deity would bother sending clues to worshipers dumb enough to use decimal instead of continued fractions. However, in 2018 we're barely able to afford a full CF version of Wolfram's birthday games. Assuming https://en.wikipedia.org/wiki/Gauss%E2%80%93Kuzmin_distribution, define In[1486]:= cfprob[L_List] := Abs@Log[2, (1 + 1/FromContinuedFraction@L)/(1 + 1/FromContinuedFraction@MapAt[# + 1 &, L, -1])] In[1487]:= cfprob[r : (Integer_ | Rational_)] := cfprob@ContinuedFraction@r Then In[1477]:= cfprob /@ Range@3 Out[1477]= {Log[4/3]/Log[2], Log[9/8]/Log[2], Log[16/15]/Log[2]} In[1478]:= N@% Out[1478]= {0.415037499278844, 0.169925001442312, 0.0931094043914815} I.e, 41.5% of terms should be 1, 17% should be 2, etc. But cfprob also gives us the probabilities of term *sequences:* In[1505]:= cfprob /@ {{1, 2, 3}, 1 + 1/(2 + 1/3), {3, 2, 1}, {2, 1, 3}} Out[1505]= {Log[221/220]/Log[2], Log[221/220]/Log[2], Log[221/220]/Log[2], Log[210/209]/Log[2]} In[1506]:= N@% Out[1506]= {0.00654284586677209, 0.00654284586677209, 0.00654284586677209, 0.00688638558523976} (Invariant under reversal but not shuffling.) This says to expect about six 1,2,3's in every burst of 1000 terms: In[1499]:= SequencePosition[ContinuedFraction[\[Pi], 10^3], {1, 2, 3}] // tim During evaluation of In[1499]:= 0.000353,6 Out[1499]= {{47, 49}, {293, 295}, {512, 514}, {542, 544}, {841, 843}, {987, 989}} In[1500]:= SequencePosition[ContinuedFraction[\[Pi], 10^3], {3, 2, 1}] // tim During evaluation of In[1500]:= 0.000403,6 Out[1500]= {{190, 192}, {585, 587}, {621, 623}, {855, 857}, {903, 905}, {922, 924}} Try a million: In[1498]:= SequencePosition[ContinuedFraction[\[Pi],10^6],{1,2,3}]//tim During evaluation of In[1498]:= 0.805228, 6561 Out[1498]= {{47,49},{293,295},{512,514},{542,544},{841,843},{987,989},{1026,1028},{1199,1201},{1237,1239}, \[CenterEllipsis]6543\[CenterEllipsis] , {999141,999143},{999146,999148},{999179,999181},{999580,999582},{999592,999594},{999689,999691}, {999708,999710},{999749,999751},{999810,999812}} (.8 seconds for a million terms. Have I actually lived to see this?) In[1501]:= 3^8 Out[1501]= 6561 In[1503]:= SequencePosition[ContinuedFraction[\[Pi],10^6],{3,2,1}]//tim;0; During evaluation of In[1503]:= 0.378853, 6477 Continued fractions accommodate fancier date formats: In[1507]:= cfprob@{3, 14, 15} Out[1507]= Log[593569/593568]/Log[2] In[1508]:= N@% Out[1508]= 2.4305451534818*10^-6 In[1509]:= SequencePosition[ContinuedFraction[\[Pi], 10^6], {3, 14, 15}] // tim During evaluation of In[1509]:= 0.39352, 2 Out[1509]= {{415314, 415316}, {607114, 607116}} Sure enough, there were two of them. But for really fancy dates, In[1511]:= cfprob@{14, 3, 2015} // N Out[1511]= 1.79490870081438*10^-10 we'll need Eric Weisstein's record π CF calculation. —rwg