Chen Prime

Author

Eric W. Weisstein
April 19, 2010

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

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

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

Code

ChenPrimeQ[p_Integer]:=Total[Last/@FactorInteger[p+2]]<3

Enumeration

Select[Prime[Range[100]],ChenPrimeQ]

Select[Prime[Range[100]],(!ChenPrimeQ[#]&)]

Biggest

Twin

IntegerLength[65516468355 2^333333+#]&/@{-1,1}

Print[{#,IntegerLength[n=65516468355 2^333333+#],PrimeQ[n]//Timing}]&/@{-1,1}

Non-Twin

IntegerLength[n=(1284991359 2^98305+1)(96060285 2^135170+1)-2+#]&/@{-1,1}

Print[{#,IntegerLength[n=(1284991359 2^98305+1)(96060285 2^135170+1)-2+#],PrimeQ[n]//Timing}]&/@{-1,1}