login
A108644
Square array A(n,k) read by ascending antidiagonals: A(n,n) = n^2, if n>k: A(n,k) = n*(n-1) + k, if k>n: A(n,k) = n + (k-1)^2.
2
1, 3, 2, 7, 4, 5, 13, 8, 6, 10, 21, 14, 9, 11, 17, 31, 22, 15, 12, 18, 26, 43, 32, 23, 16, 19, 27, 37, 57, 44, 33, 24, 20, 28, 38, 50, 73, 58, 45, 34, 25, 29, 39, 51, 65, 91, 74, 59, 46, 35, 30, 40, 52, 66, 82, 111, 92, 75, 60, 47, 36, 41, 53, 67, 83, 101
OFFSET
1,2
COMMENTS
The table gives all positive integers exactly once.
FORMULA
From G. C. Greubel, Oct 18 2023: (Start)
T(n, k) = A(n-k+1, k) (antidiagonal triangle).
T(n, n) = A002522(n-1).
T(2*n, n) = A005563(n).
T(2*n-1, n) = A000290(n).
T(2*n-2, n) = A002378(n-1), n >= 2.
T(3*n, n) = A033954(n).
Sum_{k=1..n} T(n, k) = A274248(n). (End)
Let M be the upper left n X n submatrix of this array, then abs(det(M)) = A098557(n). - Thomas Scheuerle, Nov 11 2023
EXAMPLE
Array begins:
1 2 5 10 17 26 37 ...
3 4 6 11 18 27 38 ...
7 8 9 12 19 28 39 ...
13 14 15 16 20 29 40 ...
21 22 23 24 25 30 41 ...
31 32 33 34 35 36 42 ...
43 44 45 46 47 48 49 ...
...
Antidiagonal triangle begins as:
1;
3, 2;
7, 4, 5;
13, 8, 6, 10;
21, 14, 9, 11, 17;
31, 22, 15, 12, 18, 26;
43, 32, 23, 16, 19, 27, 37;
...
MATHEMATICA
A[n_, k_]:= If[k<n, k +n*(n-1), If[k==n, n^2, n +(k-1)^2]];
A108644[n_, k_]:= A[n-k+1, k];
Table[A108644[n, k], {n, 12}, {k, n}]//Flatten (* G. C. Greubel, Oct 18 2023 *)
PROG
(PARI) A(i, j)=if (i==j, i^2, if (i>j, i*(i-1)+j, (j-1)^2+i));
matrix(7, 7, n, k, A(n, k)) \\ Michel Marcus, Dec 30 2020
(Magma)
A:= func< n, k | k lt n select k+n*(n-1) else k eq n select n^2 else n+(k-1)^2 >;
A108644:= func< n, k | A(n-k+1, k) >;
[A108644(n, k): k in [1..n], n in [1..12]]; // G. C. Greubel, Oct 18 2023
(SageMath)
def A(n, k):
if k<n: return k+n*(n-1)
elif k==n: return n^2
else: return n+(k-1)^2
def A108644(n, k): return A(n-k+1, k)
flatten([[A108644(n, k) for k in range(1, n+1)] for n in range(1, 13)]) # G. C. Greubel, Oct 18 2023
CROSSREFS
Cf. A002522 (1st row), A002061 (1st column), A000290 (diagonal).
Sequence in context: A194071 A194104 A277679 * A194011 A375890 A370698
KEYWORD
nonn,tabl
AUTHOR
Pierre CAMI, Jun 27 2005
STATUS
approved