|
|
A232243
|
|
a(n) = wt(n^2) - wt(n), where wt(n) = A000120(n) is the binary weight function.
|
|
1
|
|
|
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 2, 0, 1, 0, 0, 0, 1, 1, 2, 1, 3, 2, -1, 0, 2, 1, 2, 0, 1, 0, 0, 0, 1, 1, 2, 1, 3, 2, 3, 1, 2, 3, 3, 2, 4, -1, -1, 0, 2, 2, 1, 1, 4, 2, 2, 0, 2, 1, 2, 0, 1, 0, 0, 0, 1, 1, 2, 1, 3, 2, 3, 1, 3, 3, 5, 2, 3, 3, 0, 1, 3, 2, 4, 3, 3, 3, 2, 2, 5, 4, 0, -1, 1, -1, -1, 0, 2, 2, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,12
|
|
COMMENTS
|
A077436 gives n for which this sequence is zero.
A094694 gives n for which this sequence is negative.
|
|
LINKS
|
Table of n, a(n) for n=0..99.
|
|
FORMULA
|
a(n) = A159918(n) - A000120(n).
|
|
EXAMPLE
|
a(5) : 5 is 101, 25 is 11001, so a(5) is 3 - 2 = 1.
a(23) : 23 is 10111, 529 is 10001001, so a(23) = 3 - 4 = -1.
|
|
PROG
|
(JavaScript)
function bitCount(n) {
var i, c, s;
c=0;
s=n.toString(2);
for (i=0; i<s.length; i++) if (s.charAt(i)==1) c++;
return c;
}
for (i=0; i<100; i++) document.write(bitCount(i*i)-bitCount(i)+", ");
|
|
CROSSREFS
|
Cf. A000120, A159918, A077436, A094694, A231898.
Sequence in context: A231189 A219558 A279210 * A034876 A091393 A284557
Adjacent sequences: A232240 A232241 A232242 * A232244 A232245 A232246
|
|
KEYWORD
|
sign,base
|
|
AUTHOR
|
Jon Perry, Nov 20 2013
|
|
STATUS
|
approved
|
|
|
|