|
|
A348684
|
|
Triangle read by rows, T(n, k) = 2*n - HammingWeight(k), for 0 <= k <= n.
|
|
4
|
|
|
0, 2, 1, 4, 3, 3, 6, 5, 5, 4, 8, 7, 7, 6, 7, 10, 9, 9, 8, 9, 8, 12, 11, 11, 10, 11, 10, 10, 14, 13, 13, 12, 13, 12, 12, 11, 16, 15, 15, 14, 15, 14, 14, 13, 15, 18, 17, 17, 16, 17, 16, 16, 15, 17, 16, 20, 19, 19, 18, 19, 18, 18, 17, 19, 18, 18
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
EXAMPLE
|
Triangle starts:
[0] 0;
[1] 2, 1;
[2] 4, 3, 3;
[3] 6, 5, 5, 4;
[4] 8, 7, 7, 6, 7;
[5] 10, 9, 9, 8, 9, 8;
[6] 12, 11, 11, 10, 11, 10, 10;
[7] 14, 13, 13, 12, 13, 12, 12, 11;
[8] 16, 15, 15, 14, 15, 14, 14, 13, 15;
[9] 18, 17, 17, 16, 17, 16, 16, 15, 17, 16;
|
|
MAPLE
|
HammingWeight := n -> add(i, i = convert(n, base, 2)):
A348684 := (n, k) -> 2*n - HammingWeight(k):
seq(seq(A348684(n, k), k = 0..n), n = 0..10);
|
|
MATHEMATICA
|
Table[2*n - DigitCount[k, 2, 1], {n, 0, 10}, {k, 0, n}] // Flatten (* Amiram Eldar, Oct 30 2021 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|