|
|
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:
|
|
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
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|