OFFSET
1,2
COMMENTS
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.
Subtracting (n^2 - n)/2 if n is even from each term in row n produces a permutation of 1 .. 3n/2. Subtracting (n^2 - 1)/2 if n is odd from each term in row n produces a permutation of 1 .. (n+1)/2.
These permutations are inverses of the corresponding permutations from A377137. The algorithm used to generate them is described in A209278.
The sequence is an intra-block permutation of the positive integers.
LINKS
Boris Putievskiy, Table of n, a(n) for n = 1..9940
Boris Putievskiy, Integer Sequences: Irregular Arrays and Intra-Block Permutations, arXiv:2310.18466 [math.CO], 2023.
FORMULA
Array T(n,k) (see Example):
T(n, k) = P(n, k) + A265225(n-1), where
P(n, k) = (b(n) - k + 2)/2 if mod(b(n) - k, 2) = 0,
P(n, k) = (b(n) + k + 1)/2 if mod(b(n) - k, 2) = 1.
b(n) = (4n + 1 + (2n - 1) * (-1)^n)/4 is the length of the row n.
EXAMPLE
Array begins:
k = 1 2 3 4 5 6
n=1: 1;
n=2: 3, 4, 2;
n=3: 6, 5;
n=4: 10, 9, 11, 8, 12, 7;
The triangular arrays alternate by row: n=1 and n=3 comprise one, and n=2 and n=4 comprise the other. Subtracting 1, 4, and 6 from the elements of rows 2, 3, and 4, respectively, produces permutations:
1;
2, 3, 1;
2, 1;
4, 3, 5, 2, 6, 1;
...
These permutations are the inverses of those in Example A377137, listed in the same order.
(2,3,1)^(-1) = (3,1,2); (2,1)^(-1) = (2,1); (4,3,5,2,6,1)^(-1) = (6,4,2,1,3,5).
MATHEMATICA
b[n_]:=(4n+1+(2n-1)*(-1)^n)/4; P[n_, k_]:=If[EvenQ[b[n]-k], (b[n]-k+2)/2, (b[n]+k+1)/2]; Res[n_, k_]:=P[n, k]+(-(-1)^n*n+(-1)^n+2 n^2-n-1)/4;
Nmax=4; resultTable=Table[Res[n, k], {n, 1, Nmax}, {k, 1, b[n]}]//Flatten
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Boris Putievskiy, Nov 17 2024
STATUS
approved