cp's OEIS Frontend

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.

A352778 Numbers k such that w(k + w(k)) > w(k), where w(k) is the binary weight of k, A000120(k).

This page as a plain text file.
%I A352778 #16 Apr 03 2022 09:56:27
%S A352778 2,4,5,8,9,12,16,17,20,24,26,27,28,32,33,36,40,42,43,44,48,50,51,52,
%T A352778 56,57,58,64,65,68,72,74,75,76,80,82,83,84,88,89,90,96,98,99,100,104,
%U A352778 105,106,112,113,114,118,120,121,122,128,129,132,136,138,139,140,144,146,147,148,152,153,154,160,162,163,164
%N A352778 Numbers k such that w(k + w(k)) > w(k), where w(k) is the binary weight of k, A000120(k).
%F A352778 k : A000120(A092391(k)) > A000120(k); A348367(k) > A000120(k).
%e A352778 k = 17; A000120(17 + A000120(17)) > A000120(17), thus k = 17 is a term.
%t A352778 w[n_] := DigitCount[n, 2, 1]; Select[Range[200], w[# + w[#]] > w[#] &] (* _Amiram Eldar_, Apr 02 2022 *)
%o A352778 (Python)
%o A352778 def w(n): return bin(n).count("1")
%o A352778 def ok(n): wn = w(n); return w(n + wn) > wn
%o A352778 print([k for k in range(165) if ok(k)]) # _Michael S. Branicky_, Apr 02 2022
%Y A352778 Cf. A000120, A092391, A348367.
%K A352778 nonn,base,easy
%O A352778 1,1
%A A352778 _Ctibor O. Zizka_, Apr 02 2022