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.

Showing 1-2 of 2 results.

A378127 Inverse permutation to A377137.

Original entry on oeis.org

1, 3, 4, 2, 6, 5, 10, 9, 11, 8, 12, 7, 14, 15, 13, 20, 21, 19, 22, 18, 23, 17, 24, 16, 27, 26, 28, 25, 35, 34, 36, 33, 37, 32, 38, 31, 39, 30, 40, 29, 43, 44, 42, 45, 41, 53, 54, 52, 55, 51, 56, 50, 57, 49, 58, 48, 59, 47, 60, 46, 64, 63, 65, 62, 66, 61, 76, 75, 77, 74, 78, 73, 79, 72, 80, 71, 81, 70, 82, 69, 83, 68, 84, 67, 88, 89, 87, 90, 86, 91
Offset: 1

Views

Author

Boris Putievskiy, Nov 17 2024

Keywords

Comments

Array read by rows (blocks). Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block.
Row n has length A064455(n). The sequence A064455 is non-monotonic.
Subtracting (n^2 - n)/2 if n is even from each term in row n produces a permutation of 1 .. 3n/2. Subtracting (n^2 - 1)/2 if n is odd from each term in row n produces a permutation of 1 .. (n+1)/2.
These permutations are inverses of the corresponding permutations from A377137. The algorithm used to generate them is described in A209278.
The sequence is an intra-block permutation of the positive integers.

Examples

			Array begins:
     k =  1   2   3   4   5   6
  n=1:    1;
  n=2:    3,  4,  2;
  n=3:    6,  5;
  n=4:   10,  9, 11,  8, 12, 7;
 The triangular arrays alternate by row: n=1 and n=3 comprise one, and n=2 and n=4 comprise the other. Subtracting 1, 4, and 6 from the elements of rows 2, 3, and 4, respectively, produces permutations:
  1;
  2, 3, 1;
  2, 1;
  4, 3, 5, 2, 6, 1;
  ...
These permutations are the inverses of those in Example A377137, listed in the same order.
(2,3,1)^(-1) = (3,1,2); (2,1)^(-1) = (2,1); (4,3,5,2,6,1)^(-1) = (6,4,2,1,3,5).
		

Crossrefs

Programs

  • Mathematica
    b[n_]:=(4n+1+(2n-1)*(-1)^n)/4;P[n_,k_]:=If[EvenQ[b[n]-k],(b[n]-k+2)/2,(b[n]+k+1)/2];Res[n_,k_]:=P[n,k]+(-(-1)^n*n+(-1)^n+2 n^2-n-1)/4;
    Nmax=4;resultTable=Table[Res[n,k],{n,1,Nmax},{k,1,b[n]}]//Flatten

Formula

Array T(n,k) (see Example):
T(n, k) = P(n, k) + A265225(n-1), where
P(n, k) = (b(n) - k + 2)/2 if mod(b(n) - k, 2) = 0,
P(n, k) = (b(n) + k + 1)/2 if mod(b(n) - k, 2) = 1.
b(n) = (4n + 1 + (2n - 1) * (-1)^n)/4 is the length of the row n.

A378626 Table T(n, k) read by upward antidiagonals. T(n,1) = A377137(n), T(n,2) = A377137(A377137(n)), T(n,3) = A377137(A377137(A377137(n))) and so on.

Original entry on oeis.org

1, 4, 1, 2, 3, 1, 3, 4, 2, 1, 6, 2, 3, 4, 1, 5, 5, 4, 2, 3, 1, 12, 6, 6, 3, 4, 2, 1, 10, 11, 5, 5, 2, 3, 4, 1, 8, 7, 9, 6, 6, 4, 2, 3, 1, 7, 10, 12, 8, 5, 5, 3, 4, 2, 1, 9, 12, 7, 11, 10, 6, 6, 2, 3, 4, 1, 11, 8, 11, 12, 9, 7, 5, 5, 4, 2, 3, 1, 15, 9, 10, 9, 11, 8, 12, 6, 6, 3, 4, 2, 1, 13, 14, 8, 7, 8, 9, 10, 11, 5, 5, 2, 3, 4, 1, 14, 15, 13, 10, 12, 10, 8, 7, 9, 6, 6, 4, 2
Offset: 1

Views

Author

Boris Putievskiy, Dec 02 2024

Keywords

Comments

The sequence A377137 generates infinite cyclic group under composition. The identity element is A000027.
Each column is 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.
Row n has length A064455(n). The sequence A064455 is non-monotonic.
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).
Each column is an intra-block permutation of the positive integers.

Examples

			Table begins:
  k =      1   2   3   4   5   6
--------------------------------------
  n =  1:  1,  1,  1,  1,  1,  1, ...
  n =  2:  4,  3,  2,  4,  3,  2, ...
  n =  3:  2,  4,  3,  2,  4,  3, ...
  n =  4:  3,  2,  4,  3,  2,  4, ...
  n =  5:  6,  5,  6,  5,  6,  5, ...
  n =  6:  5,  6,  5,  6,  5,  6, ...
  n =  7: 12, 11,  9,  8, 10,  7, ...
  n =  8: 10,  7, 12, 11,  9,  8, ...
  n =  9:  8, 10,  7, 12, 11,  9, ...
  n = 10:  7, 12, 11,  9,  8, 10, ...
  n = 11:  9,  8, 10,  7, 12, 11, ...
  n = 12: 11,  9,  8, 10,  7, 12, ...
  n = 13: 15, 14, 13, 15, 14, 13, ...
  n = 14: 13, 15, 14, 13, 15, 14, ...
  n = 15: 14, 13, 15, 14, 13, 15, ...
Column k = 1 contains the start of A377137. Ord(T(1,1),T(2,1), ... T(15,1)) = 6, ord(T(1,1),T(2,1), ... T(24,1)) = 18, ord(T(1,1),T(2,1), ... T(45,1)) = 90, ord(T(1,1),T(2,1), ... T(112,1)) = 1260, where ord is order of permutation.
The first 6 antidiagonals are:
  1;
  4, 1;
  2, 3, 1;
  3, 4, 2, 1;
  6, 2, 3, 4, 1;
  5, 5, 4, 2, 3, 1;
		

Crossrefs

Cf. A000027, A064455 (row lengths), A265225, A377137, A378127.

Programs

  • 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] (*A377137*)
    composeSequence[a_,n_,k_]:=Nest[a,n,k]
    Nmax=15;Kmax=6;T=Table[composeSequence[a,n,k],{n,1,Nmax},{k,1,Kmax}]

Formula

(T(1,k),T(2,k), ... T(A265225(n),k)) is permutation of the integers from 1 to A265225(n). (T(1,k),T(2,k), ... T(A265225(n),k)) = (T(1,1),T(2,1), ... T(A265225(n),1))^k.
Showing 1-2 of 2 results.