OFFSET
0,2
COMMENTS
n-th row = (n+1) terms of an infinitely periodic cycle: (..., 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 2, 2, 1), shifting to the right one place for the next row.
Construct an A010892 decrescendo triangle: (1; 1,1; 0,1,1; -1,0,1,1; ...) and take partial sums starting from the right.
FORMULA
T(n, k) = 1 + A010892(n-k-1), with 0 <= k <= n. - Stefano Spezia, Feb 11 2023
EXAMPLE
First few rows of the triangle:
1;
2, 1;
2, 2, 1;
1, 2, 2, 1;
0, 1, 2, 2, 1;
0, 0, 1, 2, 2, 1;
1, 0, 0, 1, 2, 2, 1;
2, 1, 0, 0, 1, 2, 2, 1;
2, 2, 1, 0, 0, 1, 2, 2, 1;
1, 2, 2, 1, 0, 0, 1, 2, 2, 1;
0, 1, 2, 2, 1, 0, 0, 1, 2, 2, 1;
...
Row 3 = (1, 2, 2, 1) = partial sums of (-1, 0, 1, 1).
MATHEMATICA
A010892[n_]:={1, 1, 0, -1, -1, 0}[[Mod[n, 6]+1]]; T[n_, k_]:=1+A010892[n-k-1]; Table[T[n, k], {n, 0, 11}, {k, 0, n}]//Flatten (* Stefano Spezia, Feb 11 2023 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Gary W. Adamson, Sep 10 2008
STATUS
approved