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.
%I A065181 #7 May 02 2017 22:17:15 %S A065181 0,1,2,5,3,4,6,7,14,23,17,20,8,11,12,22,13,21,9,10,16,18,15,19,24,25, %T A065181 26,29,27,28,54,55,86,119,95,110,62,71,78,116,79,113,65,68,92,102,89, %U A065181 103,30,31,38,47,41,44,48,49,84,118,94,108,50,53,80,117,83,109,51,52 %N A065181 Permutation of nonnegative integers produced when the finite permutations listed by A055089 are subjected to inverse of Foata's transformation. Inverse of A065182. %C A065181 Here we use the inverse of the left-right maxima variant of Foata's transformation, which works by rotating each cycle largest element first and then sorts the cycles to ascending order, according to that first (and largest) element of each. %D A065181 I.M. Gessel and R. P. Stanley, Algebraic Enumeration, chapter 21 in Handbook of Combinatorics, Vol. 2, edited by R.L.Graham et al., The MIT Press, Mass, 1995, page 1045. %H A065181 Joe Buhler and R. L. Graham, <a href="http://www.cecm.sfu.ca/organics/papers/buhler/index.html">Juggling Drops and Descents</a>, Amer. Math. Monthly, 101, (no. 6) 1994, 507 - 519. %H A065181 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %p A065181 [seq(PermRevLexRank(FoataInv(PermRevLexUnrank(j))),j=0..119)]; %p A065181 with(group); FoataInv := p -> map(op, sort([op(map(RotCycleLargestFirst,convert(p,`disjcyc`))),op(FixedCycles(p))], sortbyfirst)); %p A065181 sortbyfirst := (a,b) -> `if`((a[1] < b[1]),true,false); %p A065181 FindLargest := proc(a) local i,m; m := 0; for i from 1 to nops(a) do if(0 = m) then m := i; else if(a[i] > a[m]) then m := i; fi; fi; od; RETURN(m); end; %p A065181 RotCycleLargestFirst := proc(c) local x; x := FindLargest(c); if(x <= 1) then RETURN(c); else RETURN([op(c[x..nops(c)]),op(c[1..(x-1)])]); fi; end; %p A065181 FixedCycles := proc(p) local a,i; a := []; for i from 1 to nops(p) do if(p[i] = i) then a := [op(a),[i]]; fi; od; RETURN(a); end; %Y A065181 A065161-A065163 give cycle counts and max lengths. Cf. also A065183, A065184 and A055089 and A056019 for the requisite Maple procedures. %K A065181 nonn %O A065181 0,3 %A A065181 _Antti Karttunen_, Oct 19 2001