login
A348687
Triangle read by rows, T(n, k) = n - HammingWeight(k), for 0 <= k <= n.
4
0, 1, 0, 2, 1, 1, 3, 2, 2, 1, 4, 3, 3, 2, 3, 5, 4, 4, 3, 4, 3, 6, 5, 5, 4, 5, 4, 4, 7, 6, 6, 5, 6, 5, 5, 4, 8, 7, 7, 6, 7, 6, 6, 5, 7, 9, 8, 8, 7, 8, 7, 7, 6, 8, 7, 10, 9, 9, 8, 9, 8, 8, 7, 9, 8, 8, 11, 10, 10, 9, 10, 9, 9, 8, 10, 9, 9, 8
OFFSET
0,4
EXAMPLE
Triangle starts:
[0] 0;
[1] 1, 0;
[2] 2, 1, 1;
[3] 3, 2, 2, 1;
[4] 4, 3, 3, 2, 3;
[5] 5, 4, 4, 3, 4, 3;
[6] 6, 5, 5, 4, 5, 4, 4;
[7] 7, 6, 6, 5, 6, 5, 5, 4;
[8] 8, 7, 7, 6, 7, 6, 6, 5, 7;
[9] 9, 8, 8, 7, 8, 7, 7, 6, 8, 7;
MAPLE
HammingWeight := n -> add(i, i = convert(n, base, 2)):
A348687 := (n, k) -> n - HammingWeight(k):
seq(seq(A348687(n, k), k = 0..n), n = 0..11);
MATHEMATICA
Table[n - DigitCount[k, 2, 1], {n, 0, 11}, {k, 0, n}] // Flatten (* Amiram Eldar, Oct 30 2021 *)
CROSSREFS
Cf. A000120, A001477, A011371, A122247 (row sums), A057427 (row gcd).
Sequence in context: A278042 A338714 A211161 * A208101 A131333 A120643
KEYWORD
nonn,tabl
AUTHOR
Peter Luschny, Oct 29 2021
STATUS
approved