OFFSET
1,3
COMMENTS
T(n, k) is the k-th diagonal element of an n X n square matrix M(n) formed by writing the numbers 1, ..., n^2 successively forward and backward along the rows in zig-zag pattern.
It includes exclusively all the odd numbers (A005408). Except the term 1, all the other odd numbers appear a finite number of times.
LINKS
Stefano Spezia, Table of n, a(n) for n = 1..11325 (first 150 rows of the triangle, flattened).
FORMULA
O.g.f.: (1 + y - 3*y^2 + y^3 + x*(-1 - y + 5*y^2 + y^3))/((-1 + x)^2*(-1 + y)^2*(1+y)^2).
E.g.f.: exp(x - y)*(1 + x + 2*y + exp(2*y)*(1 + x*(-1 + 2*y)))/2.
EXAMPLE
1
1, 3
1, 5, 9,
1, 7, 11, 13
1, 9, 13, 17, 25
1, 11, 15, 21, 29, 31
1, 13, 17, 25, 33, 37, 49
...
MATHEMATICA
Table[1+k(n-1)+(2k-n-1)Mod[k, 2], {n, 12}, {k, n}]//Flatten
PROG
(PARI) T(n, k) = 1 + k*(n - 1) + (2*k - n - 1)*(k % 2); \\ Michel Marcus, Jan 25 2021
CROSSREFS
Cf. A000012 (1st column), A006010 (sum of the first n rows), A060747 (2nd column), A074147 (antidiagonals of M matrices), A241016 (row sums of M matrices), A317617 (column sums of M matrices), A322277 (permanent of M matrices), A323723 (subdiagonal sum of M matrices), A323724 (superdiagonal sum of M matrices).
KEYWORD
nonn,tabl
AUTHOR
Stefano Spezia, Jan 22 2021
STATUS
approved
