login
Chen numbers which are also twin primes.
0

%I #12 Jul 28 2023 19:12:51

%S 3,5,7,11,13,17,19,29,31,41,59,71,101,107,109,137,139,149,179,181,191,

%T 197,199,227,239,269,281,311,347,419,431,461,521,569,571,599,617,641,

%U 659,809,811,821,827,829,857,881,1019,1031,1049,1061,1091,1151,1229

%N Chen numbers which are also twin primes.

%e (3, 5) are twin numbers and also Chen numbers.

%p ischenprime:=proc(n); if (isprime(n) = 'true') then if (isprime(n+2) = 'true' or numtheory[bigomega](n+2) = 2) then RETURN('true') else RETURN('false') fi fi end:

%p ts_chen_twin_primes:=proc(n) local i, ans; ans:=[ ]: for i from 1 to n do if (ischenprime(i) = 'true') and (isprime(i+2) = 'true' or isprime(i-2) = 'true') then ans:=[op(ans), i]: fi od; RETURN(ans) end:

%p ts_chen_twin_primes(1230);

%t Select[Prime[Range[250]],PrimeOmega[#+2]<3&&AnyTrue[#+{2,-2},PrimeQ]&] (* _Harvey P. Dale_, Jul 28 2023 *)

%Y Cf. A001097, A109611.

%K nonn

%O 1,1

%A _Jani Melik_, Apr 22 2006

%E Corrected and extended by _Jani Melik_, May 04 2013