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 A352785 #13 May 24 2022 18:12:00 %S A352785 0,2,5,12,14,20,22,25,27,28,36,38,41,43,44,52,57,58,68,70,73,75,76,84, %T A352785 89,90,100,105,106,115,120,122,125,132,134,137,139,140,148,153,154, %U A352785 164,169,170,179,184,186,189,196,201,202,211,216,218,221,232,234,237,241,243,249,252,254,260,262,265,267,268,276 %N A352785 Numbers k such that w(k - w(k)) = w(k), where w(k) is the binary weight of k, A000120(k). %H A352785 Michael S. Branicky, <a href="/A352785/b352785.txt">Table of n, a(n) for n = 1..10000</a> %F A352785 k : A000120(A011371(k)) = A000120(k); A352784(k) = A000120(k). %e A352785 k = 20; A000120(20 - A000120(20)) = A000120(20), thus k = 20 is a term. %p A352785 q:= n-> (w-> w(n-w(n))=w(n))(k-> add(i, i=Bits[Split](k))): %p A352785 select(q, [$0..300])[]; # _Alois P. Heinz_, May 24 2022 %t A352785 w[n_] := DigitCount[n, 2, 1]; Select[Range[0, 300], w[# - w[#]] == w[#] &] (* _Amiram Eldar_, Apr 02 2022 *) %o A352785 (Python) %o A352785 def w(n): return bin(n).count("1") %o A352785 def ok(n): wn = w(n); return w(n - wn) == wn %o A352785 print([k for k in range(277) if ok(k)]) # _Michael S. Branicky_, Apr 02 2022 %Y A352785 Cf. A000120, A011371, A352784. %K A352785 nonn,base,easy %O A352785 1,2 %A A352785 _Ctibor O. Zizka_, Apr 02 2022