A181602 Primes p such that p-1 is a semiprime and p+2 is prime or prime squared.
5, 7, 11, 23, 47, 59, 107, 167, 179, 227, 347, 359, 839, 1019, 1319, 1367, 1487, 1619, 2027, 2207, 2999, 3119, 3167, 3467, 4127, 4259, 4547, 4787, 4799, 5099, 5639, 5879, 6659, 6779, 6827, 7559, 8819, 10007, 10607, 11699, 12107, 12539, 14387, 14867
Offset: 1
Keywords
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Crossrefs
Programs
-
Magma
[ p: p in PrimesInInterval(3,15000) | &+[ k[2]: k in Factorization(p-1) ] eq 2 and (IsPrime(p+2) or (q^2 eq p+2 and IsPrime(q) where q is Isqrt(p+2))) ]; // Klaus Brockhaus, Nov 03 2010
-
Mathematica
semiPrimeQ[n_] := Plus @@ Last /@ FactorInteger@n == 2; fQ[n_] := Block[{fi = FactorInteger@n}, Length@ fi == 1 && fi[[1, 2]] == 1 || fi[[1, 2]] == 2]; Select[ Prime@ Range@ 1293, semiPrimeQ[ # - 1] && fQ[ # + 2] &] (* Robert G. Wilson v, Nov 06 2010 *) Select[Prime[Range[2000]],PrimeOmega[#-1]==2&&Or@@PrimeQ[{#+2, Sqrt[ #+2]}]&] (* Harvey P. Dale, Aug 12 2012 *)
Extensions
Corrected (29 removed) and extended by Klaus Brockhaus, Robert G. Wilson v and R. J. Mathar, Nov 03 2010
Comments