|
|
A137331
|
|
a(n) = 1 if the binary weight of n is prime, otherwise 0.
|
|
1
|
|
|
0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(0) = 0 (binary). Bits set = 0, 0 not prime -> 0.
a(1) = 1 (binary). Bits set = 1, 1 not prime -> 0.
a(2) = 10 (binary). Bits set = 1, 1 not prime -> 0.
a(3) = 11 (binary). Bits set = 2, 2 prime -> 1.
|
|
MAPLE
|
|
|
MATHEMATICA
|
Table[If[PrimeQ[Plus @@ IntegerDigits[n, 2]], 1, 0], {n, 0, 100}] (* Stefan Steinerberger, Apr 09 2008 *)
|
|
PROG
|
(PARI)f(n)={v=binary(n); s=0; for(k=1, #v, if(v[k]== 1, s++)); return(isprime(s))}; for(n=0, 104, if(f(n), print1("1, "), print1("0, "))) \\ Washington Bomfim, Jan 14 2011
|
|
CROSSREFS
|
Begins the same as A135136, but differs starting at a(31).
|
|
KEYWORD
|
nonn,easy,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|