OFFSET
1,2
COMMENTS
The array consists of two triangular arrays alternating row by row.
For odd n, row n consists of permutations of the integers from A001844((n-1)/2) to A265225(n-1). For even n, row n consists of permutations of the integers from A130883(n/2) to A265225(n-1).
These permutations are generated by the algorithm described A130517.
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
Linear sequence:
a(n) = P(n) + B(L(n)-1), where L(n) = ceiling(x(n)), x(n) is largest real root of the equation B(x) - n = 0. B(n) = (n+1)*(2*n-(-1)^n+5)/4 = A265225(n). P(n) = A162630(n)/2.
Array T(n,k) (see Example):
T(n, k) = P(n, k) + (n^2 - n)/2 if n is even, T(n, k) = P(n, k) + (n^2 - 1)/2 if n is odd, T(n, k) = P(n, k) + A265225(n-1). P(n, k) = |2k - 3n / 2 - 2| if n is even and if 2k <= 3n / 2 + 1, P(n, k) = |2k - 3n / 2 - 1| if n is even and if 2k > 3n / 2 + 1. P(n, k) = |2k - (n + 1) / 2 - 2| if n is odd and if 2k <= (n + 1) / 2 + 1, P(n, k) = |2k - (n + 1) / 2 - 1| if n is odd and if 2k > (n + 1) / 2 + 1. There are several special cases: P(n, 1) = 3n/2 if n is even, P(n, 1) = (n+1)/2 if n is odd. P(2, 2) = 1. P(n, n) = n/2 - 1 if n is even, P(n, n) = (n-3)/2 if n is odd.
EXAMPLE
Array begins:
k = 1 2 3 4 5 6
n=1: 1;
n=2: 4, 2, 3;
n=3: 6, 5;
n=4: 12, 10, 8, 7, 9, 11;
The triangular arrays alternate by row: n=1 and n=3 comprise one, and n=2 and n=4 comprise the other.
Subtracting (n^2 - 1)/2 if n is odd from each term in row n produces a permutation of 1 .. (n+1)/2. Subtracting (n^2 - n)/2 if n is even from each term in row n produces a permutation of 1 .. 3n/2:
1,
3, 1, 2,
2, 1,
6, 4, 2, 1, 3, 5,
...
MATHEMATICA
a[n_]:=Module[{L, R, P, Result}, L=Ceiling[Max[x/.NSolve[x*(2*(x-1)-Cos[Pi*(x-1)]+5)-4*n==0, x, Reals]]]; R=n-If[EvenQ[L], (L^2-L)/2, (L^2-1)/2]; P[(L+1)*(2*L-(-1)^L+5)/4]=If[EvenQ[L], 3L/2, (L+1)/2]; P[3]=2; P= Abs[2*R-If[EvenQ[L], 3L/2, (L+1)/2]-If[2*R<=If[EvenQ[L], 3L/2, (L+1)/2]+1, 2, 1]]; Res=P+If[EvenQ[L], (L^2-L)/2, (L^2-1)/2]; Result=Res; Result] Nmax= 12; Table[a[n], {n, 1, Nmax}]
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Boris Putievskiy, Oct 17 2024
STATUS
approved