Interprime

Author

Eric W. Weisstein
January 30, 2009

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

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

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

Listing

interprimes=Mean/@Partition[Prime[Range[2,200]],2,1]

Select[interprimes,EvenQ]

Select[interprimes,OddQ]

interprimes=Mean/@Partition[Prime[Range[2,10^6]],2,1];//Timing

Select[interprimes,PrimeQ]

Plot of Zeros

Sum[(-1)^k*Exp[(-(x-Prime[k])^2)],{k,∞}]

f=Sum[(-1)^k*Exp[(-(x-Prime[k])^2)],{k,500}];

Plot[f,{x,0,40},PlotStyle->Red,Epilog->{Blue,PointSize[.02],Point[{#,0}&/@interprimes]},AxesLabel->{x,HoldForm[f[x]]}]