OFFSET
1,2
COMMENTS
A209278 presents an algorithm for generating permutations.
The sequence is an intra-block permutation of integer positive numbers.
REFERENCES
E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 45.
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.
Eric Weisstein's World of Mathematics, Polygonal Number.
FORMULA
T(n,k) = P(n,k) + ((L(n,k)-1)^3*(k-2)+3*(L(n,k)-1)^2-(L(n,k)-1)*(k-5))/6, where L(n,k) = ceiling(x(n,k)), x(n,k) is largest real root of the equation x^3*(k - 2) + 3*x^2 - x*(k - 5) - 6*n = 0. R(n,k) = n - ((L(n,k) - 1)^3*(k-2)+3*(L(n,k)-1)^2-(L(n,k)-1)*(k-5))/6. P(n,k) = ((k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) + 2 - R(n,k)) / 2 if R is odd and (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) is odd, P(n,k) = (R(n,k) + (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) + 1) / 2 if R is odd and (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) is even, P(n,k) = ceiling(((k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) + 1) / 2) + (R(n,k) / 2) if R is even and (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) is odd, P(n,k) = ceiling(((k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) + 1) / 2) - (R(n,k) / 2) if R is even and (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) is even.
EXAMPLE
Table begins:
k = 3 4 5 6 7 8
--------------------------------------
n = 1: 1, 1, 1, 1, 1, 1, ...
n = 2: 3, 4, 4, 5, 5, 6, ...
n = 3: 4, 3, 5, 4, 6, 5, ...
n = 4: 2, 5, 3, 6, 4, 7, ...
n = 5: 8, 2, 6, 3, 7, 4, ...
n = 6: 7, 10, 2, 7, 3, 8, ...
n = 7: 9, 11, 13, 2, 8, 3, ...
n = 8: 6, 9, 12, 15, 2, 9, ...
n = 9: 10, 12, 14, 16, 18, 2, ...
n =10: 5, 8, 11, 14, 17, 20, ...
n =11: 16, 13, 15, 17, 19, 21, ...
n =12: 15, 7, 10, 13, 16, 19, ...
n =13: 17, 14, 16, 18, 20, 22, ...
n =14: 14, 6, 9, 12, 15, 18, ...
n =15: 18, 23, 17, 19, 21, 23, ...
n =16: 13, 22, 8, 11, 14, 17, ...
n =17: 19, 24, 18, 20, 22, 24, ...
n =18: 12, 21, 7, 10, 13, 16, ...
n =19: 20, 25, 30, 21, 23, 25, ...
n =20: 11, 20, 29, 9, 12, 15, ...
... .
For k = 3 the first 4 blocks have lengths 1,3,6 and 10.
For k = 4 the first 3 blocks have lengths 1,4, and 9.
For k = 5 the first 3 blocks have lengths 1,5, and 12.
Each block is a permutation of the numbers of its constituents.
The first 6 antidiagonals are:
1;
3, 1;
4, 4, 1;
2, 3, 4, 1;
8, 5, 5, 5, 1;
7, 2, 3, 4, 5, 1;
MATHEMATICA
T[n_, k_]:=Module[{L, R, P, Res, result}, L=Ceiling[Max[x/.NSolve[x^3*(k-2)+3*x^2-x*(k-5)-6*n==0, x, Reals]]];
R=n-(((L-1)^3)*(k-2)+3*(L-1)^2-(L-1)*(k-5))/6; P=Which[OddQ[R]&&OddQ[k*L*(L-1)/2-L^2+2*L], ((k*L*(L-1)/2-L^2+2*L+1-R)+1)/2, OddQ[R]&&EvenQ[k*L*(L-1)/2-L^2+2*L], (R+k*L*(L-1)/2-L^2+2*L+1)/2, EvenQ[R]&&OddQ[k*L*(L-1)/2-L^2+2*L], Ceiling[(k*L*(L-1)/2-L^2+2*L+1)/2]+R/2, EvenQ[R]&&EvenQ[k*L*(L-1)/2-L^2+2*L], Ceiling[(k*L*(L-1)/2-L^2+2*L+1)/2]-R/2];
Res=P+((L-1)^3*(k-2)+3*(L-1)^2-(L-1)*(k-5))/6; result=Res; result]
Nmax=6; Table[T[n, k], {n, 1, Nmax}, {k, 3, Nmax+2}]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Boris Putievskiy, Sep 18 2024
STATUS
approved