OFFSET
1,2
COMMENTS
Union of {0} and A099047. [R. J. Mathar, Aug 09 2010]
EXAMPLE
a(1)=0 because 0-1=-1 and 0+1=1 are nonprime; a(2)=5 because 5-1=4 and 5+1=6 are nonprime.
MATHEMATICA
Select[Range[0, 150], !PrimeQ[#-1]&&!PrimeQ[#+1]&] (* Harvey P. Dale, Aug 15 2012 *)
Join[{0}, Mean/@SequencePosition[Table[If[PrimeQ[n], 0, 1], {n, 200}], {1, x_, 1}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 17 2019 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Juri-Stepan Gerasimov, Mar 18 2010
EXTENSIONS
Corrected by Charles R Greathouse IV, Mar 18 2010
Incorrect comment removed by Lambert Meertens, Sep 11 2024
STATUS
approved