A348368 Numbers k such that w(k + w(k)) < w(k), where w(k) is the binary weight of k, A000120(k).
6, 7, 13, 14, 15, 21, 29, 30, 31, 37, 45, 46, 47, 55, 59, 60, 61, 62, 63, 69, 77, 78, 79, 87, 91, 92, 93, 94, 95, 103, 107, 108, 109, 111, 115, 123, 124, 125, 126, 127, 133, 141, 142, 143, 151, 155, 156, 157, 158, 159, 167, 171, 172, 173, 175, 179, 187, 188, 189
Offset: 1
Examples
k = 91; A000120(91 + A000120(91)) < A000120(91), thus k = 91 is a term.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
q:= n-> (wt-> is(wt(n+wt(n))
add(i, i=Bits[Split](k))): select(q, [$0..200])[]; # Alois P. Heinz, Oct 15 2021 -
Mathematica
h[n_] := DigitCount[n, 2, 1]; q[n_] := h[n + (hn = h[n])] < hn; Select[Range[200], q] (* Amiram Eldar, Oct 15 2021 *)
-
Python
def h(n): return bin(n).count('1') def ok(n): return h(n + h(n)) < h(n) print(list(filter(ok, range(1, 190)))) # Michael S. Branicky, Oct 15 2021
Comments