Twin Prime Cluster

Author

Eric W. Weisstein
August 22, 2005

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

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

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

Initialization

<<NumberTheory`NumberTheoryFunctions`

17066 91457 04411-13,501-503,507-509,591-601,639-641,669-671,747-749,807-809,and 819-821.

TwinPrimeClusterQ[p_?PrimeQ,n_]:=Module[{l=Partition[NestList[NextPrime,p,2n-1],2]},
Union[-Subtract@@@l]=={2}
]

Clusters

nonminimalclusters={{263872067,4},{127397154761,5},{1107819732821,6},{1107819732821,7},{1107819732821,8},{170669145704411,9}};

clusters={3,5,5,9419,909287,325267931,678771479,1107819732821,170669145704411,3324648277099157};

p=2;
Do[
Print[{Timing[While[!TwinPrimeClusterQ[p,n],p=NextPrime[p]]][[1]],{n,p}}],
{n,6}]

p=234237931;
Do[
Print[{Timing[While[!TwinPrimeClusterQ[p,n],p=NextPrime[p]]][[1]],{n,p}}],
{n,6,6}]

MapIndexed[{#2[[1]],#1}&,clusters]//TableForm

MapIndexed[{#2[[1]],#1}&,clusters]

TwinPrimeClusterQ@@@MapIndexed[{#1,#2[[1]]}&,clusters]//Timing