|
|
|
|
1, 3, 2, 4, 3, 1, 7, 6, 4, 3, 8, 7, 5, 4, 1, 10, 9, 7, 6, 3, 2, 11, 10, 8, 7, 4, 3, 1, 15, 14, 12, 11, 8, 7, 5, 4, 16, 15, 13, 12, 9, 8, 6, 5, 1, 18, 17, 15, 14, 11, 10, 8, 7, 3, 2, 19, 18, 16, 15, 12, 11, 9, 8, 4, 3, 1, 22, 21, 19, 18, 15, 14, 12, 11, 7, 6, 4, 3
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
G.f.: (V(x) - V(x*y)) * y/((1-x)*(1-y)) where V(x) is the g.f. of A001511.
(End)
|
|
EXAMPLE
|
First few rows of the triangle =
k=1 k=2 k=3 k=4 k=5 k=6 k=7
n=1: 1;
n=2: 3, 2;
n=3: 4, 3, 1;
n=4: 7, 6, 4, 3;
n=5: 8, 7, 5, 4, 1;
n=6: 10, 9, 7, 6, 3, 2;
n=7: 11, 10, 8, 7, 4, 3, 1;
...
Row 6 = (10, 9, 7, 6, 3, 2) = partial sums of the first 6 terms of the ruler sequence, starting from the right: (1, 2, 1, 3, 1, 2,...).
|
|
PROG
|
(PARI) T(n, k) = k--; 2*(n-k) - hammingweight(n) + hammingweight(k); \\ Kevin Ryde, Oct 07 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|