cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A383589 a(n) = A378762(A381662(n)).

Original entry on oeis.org

1, 2, 3, 6, 5, 4, 7, 10, 9, 8, 15, 12, 13, 14, 11, 16, 21, 18, 19, 20, 17, 28, 23, 26, 25, 24, 27, 22, 29, 36, 31, 34, 33, 32, 35, 30, 45, 38, 43, 40, 41, 42, 39, 44, 37, 46, 55, 48, 53, 50, 51, 52, 49, 54, 47, 66, 57, 64, 59, 62, 61, 60, 63, 58, 65, 56
Offset: 1

Views

Author

Boris Putievskiy, May 01 2025

Keywords

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 a self-inverse permutation of the positive integers.
In particular, the initial {a(1), a(2), ..., a(A000384(n+1))} is self-inverse.
The sequence is an intra-block permutation of the positive integers.
Generalization of the Cantor numbering method.

Examples

			Triangle array begins:
  k=    1   2  3  4   5   6   7   8   9
  n=1:  1;
  n=2:  2,  3, 6, 5,  4;
  n=3:  7, 10, 9, 8, 15, 12, 13, 14, 11;
(1, 2, 3, ..., 14, 11) = (1, 2, 3, ..., 12, 11) (1, 2, 3, ..., 12, 15). The first permutation on the right-hand side is from Example A378762 and the second from Example A381662.
(1, 2, 3, ..., 14, 11) = (1, 2, 3, ..., 14, 11)^(-1).
For n > 1, each row of triangle array joins two consecutive upward antidiagonals in the table:
   1,  3,  4,  8, 11, ...
   2,  5,  9, 14, 20, ...
   6, 10, 13, 19, 24, ...
   7, 12, 18, 25, 33, ...
  15, 21, 26, 34, 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;
  1, 2, 5, 4, 3;
  1, 4, 3, 2, 9, 6, 7, 8, 5.
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=(n-1)*(2*n-3)+Module[{m=2*n-1},If[k
    				

Formula

T(n,k) for 1 <= k <= 4n - 3: T(n,k) = A000384(n-1) + P(n,k), P(n, k) = k if k < m and k == 1 (mod 2), P(n, k) = m + 1 - k if k < m and k == 0 (mod 2), P(n, k) = 3m - 1 - k if k >= m and k == 1 (mod 2), P(n, k) = k if k >= m and k == 0 (mod 2), where m = 2n - 1.