OFFSET
1,2
COMMENTS
LINKS
G. C. Greubel, Rows n = 1..100 of triangle, flattened
FORMULA
From Ridouane Oudra, May 27 2019: (Start)
a(n) = t + |t^2-2n+1|, where t = floor(sqrt(2n-1)+1/2).
a(n) = A209302(2n-1).
a(n) = t + |t^2-2n+1|, where t = floor(sqrt(2n)+1/2). (End)
EXAMPLE
Northwest corner:
1 3 5 7 9
3 3 5 7 9
5 5 5 7 9
7 7 7 7 9
9 9 9 9 9
MATHEMATICA
(* First program *)
f[i_, j_] := Max[2 i - 1, 2 j - 1];
m[n_] := Table[f[i, j], {i, n}, {j, n}]
TableForm[m[6]] (* 6 X 6 principal submatrix *)
Flatten[Table[f[i, n + 1 - i],
{n, 15}, {i, n}]] (* A204022 *)
p[n_] := CharacteristicPolynomial[m[n], x];
c[n_] := CoefficientList[p[n], x]
TableForm[Flatten[Table[p[n], {n, 10}]]]
Table[c[n], {n, 12}]
Flatten[%] (* A204023 *)
TableForm[Table[c[n], {n, 10}]]
(* Second program *)
Table[Max[2*k-1, 2*(n-k)+1], {n, 12}, {k, n}]//Flatten (* G. C. Greubel, Jul 23 2019 *)
PROG
(PARI) {T(n, k) = max(2*k-1, 2*(n-k)+1)};
for(n=1, 12, for(k=1, n, print1(T(n, k), ", "))) \\ G. C. Greubel, Jul 23 2019
(Magma) [[Max(2*k-1, 2*(n-k)+1): k in [1..n]]: n in [1..12]]; // G. C. Greubel, Jul 23 2019
(Sage) [[max(2*k-1, 2*(n-k)+1) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Jul 23 2019
(GAP) Flat(List([1..12], n-> List([1..n], k-> Maximum(2*k-1, 2*(n-k)+1) ))); # G. C. Greubel, Jul 23 2019
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Clark Kimberling, Jan 11 2012
STATUS
approved