login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A261586
Odd numbers n such that the sum of the binary digits of n equals the sum of the binary digits of n^2.
3
1, 3, 7, 15, 31, 63, 79, 91, 127, 157, 159, 183, 187, 255, 279, 287, 317, 319, 351, 365, 375, 379, 445, 511, 573, 575, 637, 639, 703, 735, 751, 759, 763, 815, 893, 975, 1023, 1071, 1087, 1145, 1149, 1151, 1215, 1255, 1277, 1279, 1407, 1449, 1455, 1463
OFFSET
1,2
COMMENTS
A077436 consists of elements of this sequence times powers of 2.
Hare, Laishram, & Stoll show that this sequence is infinite. In particular for each k in {12, 13, 16, 17, 18, 19, 20, ...} there are infinitely many terms in this sequence with binary digit sum k.
Subsequence of A077436.
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
Sequence in context: A119407 A224521 A269167 * A043734 A151359 A147596
KEYWORD
nonn,base
AUTHOR
STATUS
approved