OFFSET
1,1
COMMENTS
Subsequence of A100318. For each k >= 0, a(k+1) = a(k) + 2 unless a(k) + 1 and a(k) + 3 are twin primes, in which case a(k+1) = a(k) + 4 (as a(k) - 1 and a(k) + 5 are divisible by 3).
The even nonisolated primes(n+1). - Juri-Stepan Gerasimov, Nov 09 2009
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = A167692(n+1). - Juri-Stepan Gerasimov, Nov 09 2009
MATHEMATICA
Select[2*Range[100], CompositeQ[#-1] || CompositeQ[#+1] &] (* G. C. Greubel, Mar 09 2019 *)
PROG
(PARI) forstep(n=4, 300, 2, if(isprime(n-1)+isprime(n+1)<=1, print1(n, ", ")))
(Sage) [n for n in (3..250) if mod(n, 2)==0 and (is_prime(n-1) + is_prime(n+1)) < 2] # G. C. Greubel, Mar 09 2019
CROSSREFS
Cf. A100318 (supersequence containing odd and even n), A045718 (n such that at least one of n-1 and n+1 is prime).
Cf. A167692(the even nonisolated nonprimes). - Juri-Stepan Gerasimov, Nov 09 2009
KEYWORD
nonn
AUTHOR
Rick L. Shepherd, Nov 13 2004
STATUS
approved