OFFSET
1,2
COMMENTS
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
K. G. Hare, S. Laishram, and T. Stoll, The sum of digits of n and n^2, International Journal of Number Theory 7:7 (2011), pp. 1737-1752.
Giuseppe Melfi, On simultaneous binary expansions of n and n^2, arXiv:math/0402458 [math.NT], 2004.
EXAMPLE
15 = 1111_2 and 15^2 = 11100001_2, both of which have a Hamming weight (sum of binary digits) equal to 4.
MATHEMATICA
Select[Range[1, 1463, 2], Total@ IntegerDigits[#, 2] == Total@ IntegerDigits[#^2, 2] &] (* Michael De Vlieger, Aug 29 2015 *)
PROG
(PARI) is(n)=n%2 && hammingweight(n)==hammingweight(n^2)
(Magma) [n: n in [1..1500 by 2] | &+Intseq(n, 2) eq &+Intseq(n^2, 2) ]; // Vincenzo Librandi, Aug 30 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Charles R Greathouse IV, Aug 25 2015
STATUS
approved