Pi

Author

Eric W. Weisstein
April 19, 2024

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Constants/Pi.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Pi.html.

©2024 Wolfram Research, Inc. except for portions noted otherwise

Numeric Value

N[Pi,100]

Continued Fraction

ContinuedFraction[Pi,10]

Properties

Element[Pi,#]&/@{Rationals,Algebraics}

Archimedes' Inequality

3+10/71<Pi<3+1/7

Pi Constructions

N[Pi,20]

N[355/113,20]

N[3+16/113,20]

N[6/5(1+GoldenRatio),20]

N[Sqrt[4+(3-Tan[30Degree])^2],20]

Plots

KhinchinList[x_,n_:200]:=MapIndexed[#1^(1/#2[[1]])&,Rest@FoldList[Times,1,Rest[ContinuedFraction[Mod[x,1],n+1]]]]

<<Utilities`Typesetting`

Show[GraphicsArray[Function[k,ListPlot[KhinchinList[Pi,k],PlotJoined->True,PlotStyle->Red,AxesLabel->TraditionalForm/@{n,((Subscript[a, 1])(Subscript[⋯a, n]))^InlineFraction[1,n]},
DisplayFunction->Identity,
Epilog->{Blue,Dashing[{.02}],Line[{{0,#},{k,#}}]&[2.685452001]}
]]/@{500,5000}]]//Timing

Fractional parts

Figure

With[{h=.015,dy=.08,dx=.02,c=Pi},Graphics[
Table[With[{y=-n dy,frac=FractionalPart[c Range[n]]},{
Text[n,{-dx,y},{1,0}],
Text[N@Last@frac,{1+dx,y},{-1,0}],
AbsolutePointSize[6],Point[{#,y}&/@frac],
Line[{{0,y},{1,y}}],
Line[{{#,y+h},{#,y-h}}]&/@Subdivide[0,1,n]
}],{n,10}]]]

Counts of fractional parts in equidistributed bins

A194293

(rows=Table[BinCounts[FractionalPart[Pi Range[n]],{0,1,1/n}],{n,20}])//Column

Numbers of empty intervals

A036416

Count[#,0]&/@rows

Table[Count[BinCounts[FractionalPart[Pi Range[n]],{0,1,1/n}],0],{n,95}]

Values of n  for which no bins are left blank

A036417

Position[rows,{1..}]//Flatten

BFileSequence[36417]

Position[Table[Count[BinCounts[FractionalPart[Pi Range[n]],{0,1,1/n}],0],{n,1000}],0]//Flatten//Timing

Fast algorithm from NumberTheory/EquidistributedSequence.nb

FullBinsQ[f_]:=Module[
{n=Length[f],int,part},
part=Partition[Subdivide[0.,1,n],2,1];
int=Transpose[{part[[All,1]],Sort[f],part[[All,2]]}];
AllTrue[int,Less@@#&]
]

NoBlankBins[c_,nmax_]:=Module[
{f=FractionalPart[N[c Range[nmax]]]},
Flatten@Position[Table[FullBinsQ[Take[f,n]],{n,nmax}],True]
]

AbsoluteTiming[Sequence@@Timing[NoBlankBins[Pi,5*^5]]]

Non-convergent denominator terms

terms=BFileSequence[36417]

denom=Denominator[Convergents[Pi,10]]

Intersection[denom,terms]

Complement[terms,denom]