login
A380815
a(n) = A378684(A379343(n)).
1
1, 5, 2, 4, 3, 6, 12, 9, 14, 7, 11, 10, 13, 8, 15, 23, 20, 25, 18, 27, 16, 22, 21, 24, 19, 26, 17, 28, 38, 35, 40, 33, 42, 31, 44, 29, 37, 36, 39, 34, 41, 32, 43, 30, 45, 57, 54, 59, 52, 61, 50, 63, 48, 65, 46, 56, 55, 58, 53, 60, 51, 62, 49, 64, 47, 66, 80, 77, 82, 75, 84, 73, 86, 71
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 an intra-block permutation of the positive integers.
Generalization of the Cantor numbering method.
FORMULA
(a(1),a(2), ... a(A000384(n+1)) is permutation of the positive integers from 1 to A000384(n+1). ord (a(1),a(2), ... a(A000384(n+1)) = 3, where ord is the order of the permutation.
T(n,k) for 1 <= k <= 4n - 3: T(n,k) = A000384(n-1) + P(n,k), P(n, k) = k + m(n) if k < m(n) and k mod 2 = 1, P(n, k) = -k + m(n) if k < m(n) and k mod 2 = 0, P(n, k) = k if k >= m(n) and k mod 2 = 1, P(n, k) = -k + 2 * m(n) if k >= m(n) and k mod 2 = 0, Where m(n) = 2n - 1.
EXAMPLE
Triangle array begins:
k= 1 2 3 4 5 6 7 8 9
n=1: 1;
n=2: 5, 2, 4, 3, 6;
n=3: 12, 9, 14, 7, 11, 10, 13, 8, 15;
ord(1,5,2... 10,15) = 3.
For n > 1, each row of triangle array joins two consecutive upward antidiagonals in the table:
1, 2, 6, 7, 15, ...
5, 3, 14, 8, 27, ...
4, 9, 13, 18, 26, ...
12, 10, 25, 19, 42, ...
11, 20, 24, 33, 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;
4, 1, 3, 2, 5;
6, 3, 8, 1, 5, 4, 7, 2, 9;
MATHEMATICA
T[n_, k_]:=(n-1)*(2*n-3)+Module[{m=2*n-1}, If[k<m, If[OddQ[k], k+m, -k+m], If[OddQ[k], k, -k+2*m]]]
Nmax=3; Flatten[Table[T[n, k], {n, 1, Nmax}, {k, 1, 4 n-3}]]
CROSSREFS
Cf. A016813 (row lengths), A000384, A378684, A379343.
Sequence in context: A111145 A249920 A380200 * A379342 A380245 A021660
KEYWORD
nonn,tabf,new
AUTHOR
Boris Putievskiy, Feb 04 2025
STATUS
approved