login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A378200
Table T(n, k) read by upward antidiagonals. T(n,k) = ((k + n - 1)^2 + (k - n + 1)(-1)^n + (1 - k - n)(-1)^k + (1 - k - n)(-1)^(k + n) + 2) / 2.
5
1, 5, 2, 6, 3, 4, 12, 9, 14, 7, 15, 8, 13, 10, 11, 23, 20, 25, 18, 27, 16, 28, 17, 26, 19, 24, 21, 22, 38, 35, 40, 33, 42, 31, 44, 29, 45, 30, 43, 32, 41, 34, 39, 36, 37, 57, 54, 59, 52, 61, 50, 63, 48, 65, 46, 66, 47, 64, 49, 62, 51, 60, 53, 58, 55, 56, 80, 77, 82, 75, 84, 73, 86, 71, 88, 69, 90, 67, 91, 68, 89, 70, 87, 72, 85, 74, 83, 76, 81, 78
OFFSET
1,2
COMMENTS
The sequence can be arranged in a triangular array, read by rows (blocks). Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block. Row n has a length of 4n-3 = A016813(n+1), n > 0. For n > 1, each row is a pair consecutive antidiagonals.
The sequence is an intra-block permutation of the positive integers.
Generalization of Cantor numbering method.
FORMULA
Triangular array T(n,k) for 1 <= k <= 4n - 3 (see Example):
T(n,k) = A000384(n-1) + P(n,k), P(n,k) = m(n) + k, if k < m(n) and k mod 2 = 1,
P(n,k) = m(n) - k , if k < m(n) and k mod 2 = 0, P(n,k) = 3m(n) - k - 1, if k => m(n) and k mod 2 = 1, P(n,k)= - m(n) + k + 1, if k => m(n) and k mod 2 = 0, where m(n) = 2n-1.
EXAMPLE
Table begins:
1, 2, 4, 7, 11, ...
5, 3, 14, 10, 27, ...
6, 9, 13, 18, 24, ...
12, 8, 25, 19, 42, ...
15, 20, 26, 33, 41, ...
...
The first 5 antidiagonals are:
1;
5, 2;
6, 3, 4;
12, 9, 14, 7;
15, 8, 13,10, 11;
Triangle array begins:
k= 1 2 3 4 5 6 7 8 9
n=1: 1;
n=2: 5, 2, 6, 3, 4;
n=3: 12, 9, 14, 7, 15, 8, 13, 10, 11;
Subtracting (n-1)*(2*n-3) from each term is row n produces a permutation of numbers from 1 to 4*n-3:
1;
4, 1, 5, 2, 3;
6, 3, 8, 1, 9, 2, 7, 4, 5;
MATHEMATICA
T[n_, k_] := ((k + n - 1)^2 + (k - n + 1)*(-1)^n + (1 - k - n)*(-1)^k + (1 - k - n)*(-1)^(k + n) + 2)/2;
Table[T[k, n], {k, 1, 5}, {n, 1, 5}]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Boris Putievskiy, Nov 19 2024
STATUS
approved