This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A077436 #60 Mar 18 2023 08:49:14 %S A077436 0,1,2,3,4,6,7,8,12,14,15,16,24,28,30,31,32,48,56,60,62,63,64,79,91, %T A077436 96,112,120,124,126,127,128,157,158,159,182,183,187,192,224,240,248, %U A077436 252,254,255,256,279,287,314,316,317,318,319,351,364,365,366,374,375,379,384 %N A077436 Let B(n) be the sum of binary digits of n. This sequence contains n such that B(n) = B(n^2). %C A077436 Superset of A023758. %C A077436 Hare, Laishram, & Stoll show that this sequence contains infinitely many odd numbers. 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. - _Charles R Greathouse IV_, Aug 25 2015 %H A077436 Reinhard Zumkeller, <a href="/A077436/b077436.txt">Table of n, a(n) for n = 1..10476, all terms <= 2^20</a> %H A077436 Karam Aloui, Damien Jamet, Hajime Kaneko, Steffen Kopecki, Pierre Popoli, and Thomas Stoll, <a href="https://arxiv.org/abs/2203.05451">On the binary digits of n and n^2</a>, arXiv:2203.05451 [math.NT], 2022. %H A077436 K. G. Hare, S. Laishram, and T. Stoll, <a href="http://arxiv.org/abs/1001.4170">The sum of digits of n and n^2</a>, International Journal of Number Theory 7:7 (2011), pp. 1737-1752. %H A077436 Giuseppe Melfi, <a href="https://arxiv.org/abs/math/0402458">On simultaneous binary expansions of n and n^2</a>, arXiv:math/0402458 [math.NT], 2004. %H A077436 Giuseppe Melfi, <a href="http://melfi.150m.com/presentazione.pdf">Su alcune successioni di interi</a> (English with an Italian title) %F A077436 A159918(a(n)) = A000120(a(n)). - _Reinhard Zumkeller_, Apr 25 2009 %e A077436 The element 79 belongs to the sequence because 79=(1001111) and 79^2=(1100001100001), so B(79)=B(79^2) %p A077436 select(t -> convert(convert(t,base,2),`+`) = convert(convert(t^2,base,2),`+`), [$0..1000]); # _Robert Israel_, Aug 27 2015 %t A077436 t={}; Do[If[DigitCount[n, 2, 1] == DigitCount[n^2, 2, 1], AppendTo[t, n]], {n, 0, 364}]; t %t A077436 f[n_] := Total@ IntegerDigits[n, 2]; Select[Range[0, 384], f@ # == f[#^2] &] (* _Michael De Vlieger_, Aug 27 2015 *) %o A077436 (Haskell) %o A077436 import Data.List (elemIndices) %o A077436 import Data.Function (on) %o A077436 a077436 n = a077436_list !! (n-1) %o A077436 a077436_list = elemIndices 0 %o A077436 $ zipWith ((-) `on` a000120) [0..] a000290_list %o A077436 -- _Reinhard Zumkeller_, Apr 12 2011 %o A077436 (PARI) is(n)=hammingweight(n)==hammingweight(n^2) \\ _Charles R Greathouse IV_, Aug 25 2015 %o A077436 (Magma) [n: n in [0..400] | &+Intseq(n, 2) eq &+Intseq(n^2, 2)]; // _Vincenzo Librandi_, Aug 30 2015 %o A077436 (Python) %o A077436 def ok(n): return bin(n).count('1') == bin(n**2).count('1') %o A077436 print([m for m in range(400) if ok(m)]) # _Michael S. Branicky_, Mar 11 2022 %Y A077436 Cf. A058369, A000120, A000290, A083567. %Y A077436 Cf. A211676 (number of n-bit numbers in this sequence). %Y A077436 A261586 is a subsequence. Subsequence of A352084. %K A077436 easy,nonn,base %O A077436 1,3 %A A077436 _Giuseppe Melfi_, Nov 30 2002 %E A077436 Initial 0 added by _Reinhard Zumkeller_, Apr 28 2012, Apr 12 2011