OFFSET
1,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = n + n / log n + O(n / (log n)^2) by Brun's theorem. [Charles R Greathouse IV, Mar 15 2011]
MAPLE
isA001097 := proc(n) isprime(n) and (isprime(n+2) or isprime(n-2)) ; end proc: isA164276 := proc(n) not isprime(n) and ( not isprime(n+1) or not isprime(n-1) ) ; end proc: isA167707 := proc(n) isA001097(n) or isA164276(n) ; end proc: for n from 0 to 100 do if isA167707(n) then printf("%d, ", n) ; end if; end do: # R. J. Mathar, Mar 18 2010
MATHEMATICA
Union[Select[Range[0, 300], !PrimeQ[#] && (! PrimeQ[# - 1] || ! PrimeQ[# + 1]) & ], Select[Prime[Range[300]], PrimeQ[# - 2] || PrimeQ[# + 2] &]] (* G. C. Greubel, Jul 07 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Nov 10 2009
STATUS
approved