login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #16 Apr 03 2022 09:56:27

%S 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 56,57,58,64,65,68,72,74,75,76,80,82,83,84,88,89,90,96,98,99,100,104,

%U 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 Numbers k such that w(k + w(k)) > w(k), where w(k) is the binary weight of k, A000120(k).

%F k : A000120(A092391(k)) > A000120(k); A348367(k) > A000120(k).

%e k = 17; A000120(17 + A000120(17)) > A000120(17), thus k = 17 is a term.

%t w[n_] := DigitCount[n, 2, 1]; Select[Range[200], w[# + w[#]] > w[#] &] (* _Amiram Eldar_, Apr 02 2022 *)

%o (Python)

%o def w(n): return bin(n).count("1")

%o def ok(n): wn = w(n); return w(n + wn) > wn

%o print([k for k in range(165) if ok(k)]) # _Michael S. Branicky_, Apr 02 2022

%Y Cf. A000120, A092391, A348367.

%K nonn,base,easy

%O 1,1

%A _Ctibor O. Zizka_, Apr 02 2022