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.
LINKS
Boris Putievskiy, Table of n, a(n) for n = 1..9870
Boris Putievskiy, Integer Sequences: Irregular Arrays and Intra-Block Permutations, arXiv:2310.18466 [math.CO], 2023.
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