|
|
A159918
|
|
Number of ones in binary representation of n^2.
|
|
38
|
|
|
0, 1, 1, 2, 1, 3, 2, 3, 1, 3, 3, 5, 2, 4, 3, 4, 1, 3, 3, 5, 3, 6, 5, 3, 2, 5, 4, 6, 3, 5, 4, 5, 1, 3, 3, 5, 3, 6, 5, 7, 3, 5, 6, 7, 5, 8, 3, 4, 2, 5, 5, 5, 4, 8, 6, 7, 3, 6, 5, 7, 4, 6, 5, 6, 1, 3, 3, 5, 3, 6, 5, 7, 3, 6, 6, 9, 5, 7, 7, 5, 3, 6, 5, 8, 6, 7, 7, 7, 5, 9, 8, 5, 3, 6, 4, 5, 2, 5, 5, 6, 5, 9, 5, 7, 4
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
The binary weight (A000120) of n^2.
a(n) = 0 iff n = 0. a(n) = 1 iff n = 2^k for some k >= 0. a(n) = 2 iff n = 3*2^k for some k >= 0. Szalay proves that a(n) = 3 iff n = 7*2^k, 23*2^k, or 2^a + 2^b for k >= 0 and a > b >= 0. It seems that a(n) = 4 iff n = 13*2^k, 15*2^k, 47*2^k, or 111*2^k but this has not been proven! Any other n with a(n) = 4 are greater than 10^50, and there are finitely many odd solutions. - Charles R Greathouse IV, Jan 20 2022
|
|
REFERENCES
|
L. Szalay, The equations 2^n ± 2^m ± 2^l = z^2, Indagationes Mathematicae (N.S.) 13, no. 1 (2002), pp. 131-142.
|
|
LINKS
|
|
|
FORMULA
|
Lindström shows that lim sup wt(m^2)/log_2 m = 2. - N. J. A. Sloane, Oct 11 2013
a(n) = [x^(n^2)] (1/(1 - x))*Sum_{k>=0} x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Mar 27 2018
|
|
MAPLE
|
|
|
MATHEMATICA
|
a[n_] := Total[IntegerDigits[n^2, 2]];
|
|
PROG
|
(Haskell)
(Python)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|