Twin Prime Conjecture

Author

Eric W. Weisstein
June 10, 2004

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

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

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

Twin Primes

FullSimplify[Integrate[1/Log[t]^2,{t,2,x}]]

pi2=Select[Partition[Table[Prime[n],{n,100}],2,1],
Subtract@@#==-2&]

Plot

ratio[x_?NumericQ]:=Count[Partition[Table[Prime[n],{n,PrimePi[x]}],2,1],
_?(Subtract@@#==-2&)]/((4/(Log[4]))-(x/(Log[x]))-LogIntegral[2]+LogIntegral[x])/2

<<Utilities`Typesetting`

V5

With[{n=50000},
pi2=.6601618158;
Plot[ratio[x],{x,1,n},PlotStyle->Red,
Epilog->{Text[(Subscript[Π, 2]),{1.07n,pi2},TextStyle->TraditionalForm],
Blue,Line[{{0,pi2},{10^6,pi2}}]},
PlotRange->{All,{.4,.7}},
AxesLabel->TraditionalForm/@{x,InlineFraction[(Subscript[π, 2])[x],Subscript[OverHat[π],2][x]]}
]]//Timing

V6

With[{n=50000},
pi2=.6601618158;
Plot[ratio[x],{x,1,n},PlotStyle->Red,
Epilog->{Text[(Subscript[Π, 2]),{1.07n,pi2}],Blue,Line[{{0,pi2},{10^6,pi2}}]},
PlotRange->{All,{.4,.7}},
AxesLabel->{x,InlineFraction[(Subscript[π, 2])[x],Subscript[OverHat[π],2][x]]}
]]