login
A276983
Semiprimes n such that n-1 or n+1 is prime.
1
4, 6, 10, 14, 22, 38, 46, 58, 62, 74, 82, 106, 158, 166, 178, 194, 226, 262, 278, 314, 346, 358, 382, 398, 422, 458, 466, 478, 502, 542, 562, 586, 614, 662, 674, 718, 734, 758, 838, 862, 878, 886, 982, 998, 1018, 1094, 1154, 1186, 1202, 1214, 1238, 1282, 1306, 1318, 1322
OFFSET
1,1
COMMENTS
Union of A077065 and A077068.
LINKS
FORMULA
a(n) = 2*A120628(n).
EXAMPLE
a(3) = 10 = 2*5 is a product of 2 primes and 10+1 = 11 is prime.
a(4) = 14 = 2*7 is a product of 2 primes and 14-1 = 13 is prime.
MAPLE
select(t -> isprime(t/2) and (isprime(t-1) or isprime(t+1)), [seq(i, i=2..10000, 2)]); # Robert Israel, Sep 30 2016
MATHEMATICA
func[n_] := PrimeOmega[n] == 2 && (PrimeQ[n + 1] || PrimeQ[n - 1])
Select[Range[1000], func[#] &]
PROG
(PARI) isok(n) = (bigomega(n)==2) && (isprime(n-1) || isprime(n+1)); \\ Michel Marcus, Sep 24 2016
(PARI) lista(nn) = forprime(p=2, nn, if(isprime(2*p+1) || isprime(2*p-1), print1(2*p, ", "))); \\ Altug Alkan, Sep 30 2016
(Python)
from sympy import isprime, primerange
def aupto(N): return [t for t in (2*p for p in primerange(2, N//2+1)) if isprime(t-1) or isprime(t+1)]
print(aupto(1322)) # Michael S. Branicky, Aug 21 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Gary E. Davis, Sep 24 2016
STATUS
approved