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-4 of 4 results.

A057113 Positions of permutations produced by the transposition sequence A057112 in A055089.

Original entry on oeis.org

0, 1, 4, 5, 3, 2, 12, 13, 16, 22, 19, 18, 20, 10, 7, 6, 8, 14, 15, 9, 11, 21, 23, 17, 77, 76, 73, 72, 74, 75, 85, 84, 86, 80, 78, 79, 82, 92, 90, 91, 94, 88, 89, 95, 93, 83, 81, 87, 63, 62, 60, 61, 64, 65, 71, 70, 67, 53, 51, 50, 48, 54, 56, 57, 59, 69, 68, 58, 55, 49, 52, 66, 108, 109, 112, 113, 111, 110, 104, 105, 107, 117, 119, 118, 115, 101, 99, 98, 96, 102
Offset: 0

Views

Author

Antti Karttunen, Aug 09 2000

Keywords

Crossrefs

PermRevLexRank given in A056019.

Programs

  • Maple
    atp_perm_ranks := proc(upto_n) local t,a,p,i,k; p := convert([1],'disjcyc'); k := nops(factorial_base(upto_n))+1; a := []; for i from 1 to upto_n do a := [op(a),PermRevLexRank(convert(p,'permlist',k))]; t := adj_tp_seq(i); p := mulperms([[t,t+1]],p); od; RETURN(a); end;

Formula

perm_ranks_seq := atp_perm_ranks(120);

A055089 List of all finite permutations in reversed colexicographic ordering.

Original entry on oeis.org

1, 2, 1, 1, 3, 2, 3, 1, 2, 2, 3, 1, 3, 2, 1, 1, 2, 4, 3, 2, 1, 4, 3, 1, 4, 2, 3, 4, 1, 2, 3, 2, 4, 1, 3, 4, 2, 1, 3, 1, 3, 4, 2, 3, 1, 4, 2, 1, 4, 3, 2, 4, 1, 3, 2, 3, 4, 1, 2, 4, 3, 1, 2, 2, 3, 4, 1, 3, 2, 4, 1, 2, 4, 3, 1, 4, 2, 3, 1, 3, 4, 2, 1, 4, 3, 2, 1, 1, 2, 3, 5, 4, 2, 1, 3, 5, 4, 1, 3, 2, 5, 4, 3, 1, 2
Offset: 0

Views

Author

Antti Karttunen, Apr 18 2000

Keywords

Examples

			In this table, each row consists of A001563(n) permutations of n+1 terms; i.e., we have (1/) 2,1/ 1,3,2; 3,1,2; 2,3,1; 3,2,1/ 1,2,4,3; 2,1,4,3; ... .
Append to each an infinite number of fixed terms and we get a list of rearrangements of the natural numbers, but with only a finite number of terms permuted:
1/2,3,4,5,6,7,8,9,...
2,1/3,4,5,6,7,8,9,...
1,3,2/4,5,6,7,8,9,...
3,1,2/4,5,6,7,8,9,...
2,3,1/4,5,6,7,8,9,...
3,2,1/4,5,6,7,8,9,...
1,2,4,3/5,6,7,8,9,...
2,1,4,3/5,6,7,8,9,...
Alternatively, if we take only the first n terms of each such infinite row, then the first n! rows give all permutations of the elements 1,2,...,n.
		

Crossrefs

Inversion vectors: A007623, cycle counts: A055090, minimum number of transpositions: A055091, minimum number of adjacent transpositions: A034968, order of each permutation: A055092, number of non-fixed elements: A055093, positions of inverses: A056019, positions after Foata transform: A065181; positions of fixed-point-free involutions: A064640.
Cf. A195663, array of the infinite rows.
This permutation list gives essentially the same information as A030298/A030299, but in a more compact way, by skipping those permutations of A030298 that start with a fixed element.
A220658(n) gives the rank r of the permutation of which the term at a(n) is an element.
A220659(n) gives the zero-based position (from the left) of that a(n) in that permutation of rank r.
A084558(r)+1 gives the size of the finite subsequence (of the r-th infinite, but finitary permutation) which has been included in this list.

Programs

  • Maple
    factorial_base := proc(nn) local n,a,d,j,f; n := nn; if(0 = n) then RETURN([0]); fi; a := []; f := 1; j := 2; while(n > 0) do d := floor(`mod`(n,(j*f))/f); a := [d,op(a)]; n := n - (d*f); f := j*f; j := j+1; od; RETURN(a); end;
    fexlist2permlist := proc(a) local n,b,j; n := nops(a); if(0 = n) then RETURN([1]); fi; b := fexlist2permlist(cdr(a)); for j from 1 to n do if(b[j] >= ((n+1)-a[1])) then b[j] := b[j]+1; fi; od; RETURN([op(b),(n+1)-a[1]]); end;
    fac_base := n -> fac_base_aux(n,2); fac_base_aux := proc(n,i) if(0 = n) then RETURN([]); else RETURN([op(fac_base_aux(floor(n/i),i+1)), (n mod i)]); fi; end;
    PermRevLexUnrank := n -> `if`((0 = n),[1],fexlist2permlist(fac_base(n)));
    cdr := proc(l) if 0 = nops(l) then ([]) else (l[2..nops(l)]); fi; end; # "the tail of the list"
    # Same algorithm in different guise, showing how permutations are composed of adjacent transpositions (compare to algorithm PermUnrank3R at A060117):
    PermRevLexUnrankAMSDaux := proc(n,r, pp) local s,p,k; p := pp; if(0 = r) then RETURN(p); else s := floor(r/((n-1)!)); for k from n-s to n-1 do p := permul(p,[[k,k+1]]); od; RETURN(PermRevLexUnrankAMSDaux(n-1, r-(s*((n-1)!)), p)); fi; end;
    PermRevLexUnrankAMSD := proc(r) local n; n := nops(factorial_base(r)); convert(PermRevLexUnrankAMSDaux(n+1,r,[]),'permlist',1+(((r+2) mod (r+1))*n)); end;
  • Mathematica
    A055089L[n_] := Reverse@SortBy[DeleteCases[Permutations@Range@n, {, n}], Reverse]; Flatten@Array[A055089L, 4] (* JungHwan Min, Aug 28 2016 *)

Formula

[seq(op(PermRevLexUnrank(j)), j=0..)]; (see Maple code given below).

Extensions

Name changed by Tilman Piesk, Feb 01 2012

A060135 Sequence of adjacent transpositions (a[n] a[n]+1), which, when starting from the identity permutation and applied successively, produce a Hamiltonian circuit through all permutations of S_4, in such a way that S_{n-1} is always traversed before the rest of S_n. Furthermore, each subsequence from the first to the (n!-1)-th term is palindromic.

Original entry on oeis.org

1, 2, 1, 2, 1, 3, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 3, 1, 2, 1, 2, 1
Offset: 0

Views

Author

Antti Karttunen, Mar 02 2001

Keywords

Comments

This is lexicographically the ninth of all such Hamiltonian paths through S4.
I will try to extend this in some elegant fashion through all S_inf so that the same criteria will hold. There are 466 ways to extend this to S5.

Crossrefs

Cf. A057112.

Programs

  • Maple
    sol9seq := n -> (`if`((n < 13),adj_tp_seq(n), sol9seq(24-n)));

Formula

[seq(sol9seq(n), n=1..23)];

A141826 Bisect sequence A057113.

Original entry on oeis.org

0, 4, 3, 12, 16, 19, 20, 7, 8, 15, 11, 23, 77, 73, 74, 85, 86, 78, 82, 90, 94, 89, 93, 81, 63, 60, 64, 71, 67, 51, 48, 56, 59, 68, 55, 52, 108, 112, 111, 104, 107, 119, 115, 99, 96, 103, 100, 116, 46, 45, 42, 29, 25, 34, 33, 41, 37, 26, 38, 30
Offset: 0

Views

Author

Alford Arnold, Aug 07 2008

Keywords

Comments

Since A057113 is generated based on A057112(n) and successive transpositions, we can be assured that A141826(n) will always map (using A055089)to permutation with an even number of transpositions (applicable, e.g. to the Icosahedron and truncated icosahedron studied in the Geometry Center at http://www.scienceu.com/geometry/facts/solids/handson.html ).

Examples

			A057113(n)is 0 1 4 5 3 2 12 13 16 22 19 18 20 10 7 6 8 14 15 9 11 21 23 17 77... so the sequence begins 0 4 3 12 16 19 20 7 8 15 11 23 77 ...
		

Crossrefs

Extensions

More terms from Alford Arnold, Aug 18 2008
Showing 1-4 of 4 results.