|
|
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
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
LINKS
|
|
|
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
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|