login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Please make a donation to keep the OEIS running. We are now in our 56th year. In the past year we added 10000 new sequences and reached almost 9000 citations (which often say "discovered thanks to the OEIS").
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A168064 Numbers n such that exactly one of n+-1 and n+-2 is prime. 1
0, 2, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22, 24, 25, 27, 28, 29, 31, 32, 33, 35, 36, 38, 40, 41, 43, 44, 46, 48, 49, 51, 52, 54, 55, 57, 58, 59, 61, 62, 63, 65, 66, 68, 70, 71, 73, 74, 75, 77, 78, 80, 82, 84, 85, 87, 88, 90, 91, 95, 96, 98, 100, 101, 103, 104, 106, 107, 109 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Harvey P. Dale, Table of n, a(n) for n = 1..1000

EXAMPLE

a(1)=0 (-2,-1 and 1 are nonprime, 2 is prime); a(2)=2 (0,1 and 4 are nonprime, 3 is prime); a(3)=7 (6,8 and 9 are nonprime, 5 is prime); a(4)=10 (8,9 and 12 are nonprime, 11 is prime); a(5)=11 (9,10 and 12 are nonprime, 13 is prime).

MATHEMATICA

Join[{0}, Select[Range[120], Total[Boole[PrimeQ[#+{-2, -1, 1, 2}]]]==1&]] (* Harvey P. Dale, Apr 09 2020 *)

PROG

(PARI) is(n)=isprime(n-2)+isprime(n-1)+isprime(n+1)+isprime(n+2)==1 \\ Charles R Greathouse IV, Jun 13 2017

CROSSREFS

Cf. A000040, A100317, A141468.

Sequence in context: A045980 A104339 A199004 * A243167 A039005 A022431

Adjacent sequences:  A168061 A168062 A168063 * A168065 A168066 A168067

KEYWORD

nonn,easy

AUTHOR

Juri-Stepan Gerasimov, Nov 18 2009

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 4 21:30 EST 2020. Contains 338939 sequences. (Running on oeis4.)