OFFSET
1,2
COMMENTS
This sequence can be regarded as a triangular array read by rows. Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block. The length of row n is 4n-3 = A016813(n-1), n > 0.
The sequence can also be regarded as a table read by upward antidiagonals. For n > 1 row n joins two consecutive antidiagonals.
The sequence is a self-inverse permutation of the positive integers.
In particular, the initial {a(1), a(2), ..., a(A000384(n+1))} is self-inverse.
The sequence is an intra-block permutation of the positive integers.
Generalization of the Cantor numbering method.
LINKS
Boris Putievskiy, Table of n, a(n) for n = 1..9730
Boris Putievskiy, Integer Sequences: Irregular Arrays and Intra-Block Permutations, arXiv:2310.18466 [math.CO], 2023.
FORMULA
T(n,k) for 1 <= k <= 4n - 3: T(n,k) = A000384(n-1) + P(n,k), P(n, k) = m - 1 - k if k < m and k == 1 (mod 2), P(n, k) = k if k < m and k == 0 (mod 2), P(n, k) = 3m - 1 - k if k >= m and k == 1 (mod 2), P(n, k) = k if k >= m and k == 0 (mod 2), where m = 2n - 1.
EXAMPLE
Triangle array begins:
k= 1 2 3 4 5 6 7 8 9
n=1: 1;
n=2: 2, 3, 6, 5, 4;
n=3: 9, 8, 7, 10, 15, 12, 13, 14, 11;
(1, 2, 3, ..., 14, 11) = (1, 2, 3, ..., 12, 11) (1, 2, 3, ..., 12, 15). The first permutation on the right-hand side is from Example A378762 and the second from Example A376214.
(1, 2, 3, ..., 14, 11) = (1, 2, 3, ..., 14, 11)^(-1).
For n > 1, each row of triangle array joins two consecutive upward antidiagonals in the table:
1, 3, 4, 10, 11, ...
2, 5, 7, 14, 16, ...
6, 8, 13, 19, 24, ...
9, 12, 18, 25, 31, ...
15, 17, 26, 32, 41, ...
...
Subtracting (n-1)*(2*n-3) from each term in row n produces a permutation of numbers from 1 to 4*n-3:
1;
1, 2, 5, 4, 3;
3, 2, 1, 4, 9, 6, 7, 8, 5.
MATHEMATICA
T[n_, k_]:=(n-1)*(2*n-3)+Module[{m=2*n-1}, If[k<m, If[OddQ[k], m-1-k, k], If[OddQ[k], 3m-1-k, k]]]
Nmax=3; Flatten[Table[T[n, k], {n, 1, Nmax}, {k, 1, 4*n-3}]]
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Boris Putievskiy, May 07 2025
STATUS
approved
