login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A171845 Numbers n >= 0 such that n-1 and n+1 are both primes or both nonprimes, but excluding primes. 1
0, 4, 6, 9, 12, 15, 18, 21, 25, 26, 27, 30, 33, 34, 35, 39, 42, 45, 49, 50, 51, 55, 56, 57, 60, 63, 64, 65, 69, 72, 75, 76, 77, 81, 85, 86, 87, 91, 92, 93, 94, 95, 99, 102, 105, 108, 111, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 129, 133, 134, 135, 138 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
MAPLE
a:=[];
for k from 0 to 5000 do
if not isprime(k) then
if (isprime(k-1) and isprime(k+1)) or
(not isprime(k-1) and not isprime(k+1)) then a:=[op(a), k]; fi; fi; od:
a; # N. J. A. Sloane, Sep 23 2019
MATHEMATICA
bpQ[n_]:=!PrimeQ[n]&&EvenQ[Total[If[PrimeQ[#], 1, 0]&/@{n-1, n+1}]]; Select[ Range[ 0, 150], bpQ] (* Harvey P. Dale, Sep 23 2019 *)
CROSSREFS
Sequence in context: A007074 A054087 A079255 * A157124 A162735 A024675
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Edited by Charles R Greathouse IV, Mar 23 2010
Definition and data corrected by N. J. A. Sloane, Sep 23 2019. Thanks to Harvey P. Dale for pointing that there were errors. - N. J. A. Sloane, Sep 23 2019
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 16:23 EDT 2024. Contains 371989 sequences. (Running on oeis4.)