Prime Distance

Author

Eric W. Weisstein
October 17, 2002

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PrimeNumbers/PrimeDistance.nb.

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

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

Initialization

<<Graphics`Colors`;

Plot

Table[Min[Abs[n-If[n<2,2,Prime[{#,#+1}&[PrimePi[n]]]]]],{n,0,26}]

Show[GraphicsArray[Function[pts,ListPlot[Table[Min[Abs[n-If[n<2,2,Prime[{#,#+1}&[PrimePi[n]]]]]],{n,0,pts}],PlotJoined->True,PlotRange->All,
PlotStyle->Red,
AxesLabel->TraditionalForm/@{n,pd[n]},
DisplayFunction->Identity]]/@{200,5000}
],
GraphicsSpacing->-.05]