login
Numbers m such that m - 2 and m + 2 are semiprimes.
10

%I #27 Sep 08 2022 08:45:17

%S 8,12,23,24,36,37,53,60,67,84,89,93,113,117,120,121,131,143,144,157,

%T 185,203,204,207,211,215,216,217,219,251,276,289,293,297,300,301,303,

%U 307,321,325,337,360,363,379,384,393,396,405,409,413,415,449,456,471,480

%N Numbers m such that m - 2 and m + 2 are semiprimes.

%C A001222(a(n)-2) = A001222(a(n)+2) = 2.

%C The even members of the sequence are A054735. - _Robert Israel_, Jan 18 2015

%C The prime members of the sequence are A063643. - _Michel Marcus_, Mar 27 2015

%H Reinhard Zumkeller, <a href="/A105571/b105571.txt">Table of n, a(n) for n = 1..10000</a>

%e From _Jon E. Schoenfield_, Jan 18 2015: (Start)

%e 12 - 2 = 10 = 2*5 and 12 + 2 = 14 = 2*7 so 12 is in the sequence.

%e 23 - 2 = 21 = 3*7 and 23 + 2 = 25 = 5*5 so 23 is in the sequence.

%e 16 - 2 = 14 = 2*7 but 16 + 2 = 18 = 2*3*3 so 16 is not in the sequence.

%e (End)

%p select(n -> numtheory:-bigomega(n+2) = 2 and numtheory:-bigomega(n-2) = 2,

%p [$1..1000]); # _Robert Israel_, Jan 18 2015

%t q=2;lst={};Do[If[Plus@@Last/@FactorInteger[n-q]==q&&Plus@@Last/@FactorInteger[n+q]==q,AppendTo[lst,n]],{n,7!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Feb 01 2009 *)

%t Select[Range[700], PrimeOmega[# + 2] == PrimeOmega[# - 2] == 2 &] (* _Vincenzo Librandi_, Mar 30 2015 *)

%o (Magma) IsSemiprime:=func< n | &+[k[2]: k in Factorization(n)] eq 2 >; [ n: n in [3..700] | IsSemiprime(n+2) and IsSemiprime(n-2) ]; // _Vincenzo Librandi_, Mar 30 2015

%o (Haskell)

%o a105571 n = a105571_list !! (n-1)

%o a105571_list = [x | x <- [3..], a064911 (x - 2) == 1, a064911 (x + 2) == 1]

%o -- _Reinhard Zumkeller_, Mar 31 2015

%Y Cf. A014574, A054735, A063643, A105572, A105573.

%Y Cf. A064911.

%K nonn

%O 1,1

%A _Reinhard Zumkeller_, Apr 14 2005