login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A168079
Numbers n such that exactly one of n+-1, n+-2 and n+-3 is prime.
1
-1, 7, 11, 13, 17, 19, 24, 25, 27, 29, 31, 33, 35, 36, 41, 43, 48, 49, 51, 52, 54, 55, 57, 59, 61, 63, 65, 66, 71, 73, 75, 77, 78, 84, 85, 87, 88, 90, 91, 92, 94, 95, 96, 101, 103, 107, 109, 114, 115, 116, 124, 125, 126, 132, 133, 135, 137, 139, 141, 142, 146, 147, 149
OFFSET
1,2
LINKS
FORMULA
a(n) ~ 6n/log n. -Charles R Greathouse IV, May 25 2011
EXAMPLE
a(1)=-1 (-4,-3,-2,0 and 1 are nonprimes, 2 is prime);
a(2)=7 (4,6,8,9 and 10 are nonprimes, 5 is prime);
a(3)=13 (8,9,10,12 and 14 are nonprimes, 11 is prime).
MATHEMATICA
f[n_] := Length[Select[Drop[Range[n - 3, n + 3], {4}], PrimeQ]] == 1; Join[{-1}, Select[Range[0, 200], f]] (* G. C. Greubel, Jul 09 2016 *)
Join[{-1}, Select[Range[200], Total[Boole[PrimeQ[Drop[Range[#-3, #+3], {4}]]]]==1&]] (* Harvey P. Dale, Oct 16 2018 *)
PROG
(PARI) is(n)=isprime(n-3) + isprime(n-2) + isprime(n-1) + isprime(n+1) + isprime(n+2) + isprime(n+3) == 1 \\ Charles R Greathouse IV, Jun 13 2017
CROSSREFS
KEYWORD
sign
AUTHOR
EXTENSIONS
Corrected (11, 57 inserted, 16 replaced by 126) by R. J. Mathar, Jun 04 2010
STATUS
approved

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy