OFFSET
1,2
COMMENTS
The sequence is an intra-block permutation of positive integers.
Generalization of the Cantor numbering method for n (n > 1) adjacent diagonals. In this approach, the block number n combines n neighboring diagonals.
Each block is filled sequentially, starting from the top of the leftmost vertical strip and moving downwards and then rightwards to the next strip. In block number n the first (n - 1)*n/2 + 1 strips each have a length of n. The remaining n - 1 strips have lengths that decrease sequentially from n - 1 down to 1. See Example the array of permutations of the triangle read upward antidiagonals.
LINKS
Boris Putievskiy, Table of n, a(n) for n = 1..9316
Boris Putievskiy, Integer Sequences: Irregular Arrays and Intra-Block Permutations, arXiv:2310.18466 [math.CO], 2023.
FORMULA
Linear sequence:
a(n) = P(n) + (L(n) - 1)*L*(L(n)^2 - L(n) + 2)/8, where L(n) =ceiling((sqrt(4*Sqrt(8*n + 1) - 3) - 1)/2), Ld(n) = ceiling((Sqrt(8*n + 1) - 1)/2), Ld(n) = A002024(n), Rd(n) = n - (Ld(n) - 1)*Ld(n)/2, Rd(n) = A002260(n),
P(n) = L(n)*Rd(n) + Ld(n) - L(n)*(L(n) + 1)/2 - Max[Rd(n) - (L(n)^2 - L(n) + 2)/2, 0]*(Max[Rd(n) - (L(n)^2 - L(n) + 2)/2, 0] + 1)/2.
Triangular array T(n,k) for 1 <= k <= n(n^2+1)/2 (see Example):
T(n,k) = (n - 1)*n*(n^2 - n + 2)/8 + P(n,k), T(n,k) = A002817(n-1) + P(n,k), where P(n,k) = n*Rd(n,k) + Ld(n,k) - n - Max[Rd(n,k) - (n^2 - n + 2)/2, 0]*(Max[Rd(n,k) - (n^2 - n + 2)/2, 0] + 1)/2, where Ld(n,k) = Ceiling[(Sqrt[(n^2 - n + 1)^2 + 8*k] - (n^2 - n + 1))/2].
EXAMPLE
Triangle begins:
k = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
n=1: 1;
n=2: 2, 4, 3, 5, 6;
n=3: 7, 10, 13, 16, 8, 11, 14, 17, 19, 9, 12, 15, 18, 20, 21;
Subtracting (n - 1)*n*(n^2-n+2)/8 from each term in row n is a permutation of 1 .. n(n^2+1)/2:
1,
1, 3, 2, 4, 5,
1, 4, 7, 10, 2, 5, 8, 11, 13, 3, 6, 9, 12, 14, 15,
...
The triangle's rows of permutations can be arranged as n successive upward antidiagonals in an array:
1, 3, 5, 10, 13, 15, ...
1, 4, 7, 11, 14, ...
2, 4, 8, 12, ...
1, 5, 9, ...
2, 6, ...
3, ...
MATHEMATICA
a[n_]:=Module[{L, Ld, Rd, P, Result}, L=Ceiling[(Sqrt[4*Sqrt[8*n+1]-3]-1)/2];
Ld=Ceiling[(Sqrt[8*n+1]-1)/2]; Rd=n-(Ld-1)*Ld/2; P=L*Rd+Ld-L*(L+1)/2-Max[Rd-(L^2-L+2)/2, 0]*(Max[Rd-(L^2-L+2)/2, 0]+1)/2; Result=P+(L-1)*L*(L^2-L+2)/8; Result]
Nmax= 21; Table[a[n], {n, 1, Nmax}]
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Boris Putievskiy, Aug 20 2024
STATUS
approved