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

A038776 The sequence a[1] to a[ cat[n] ] is the permutation that converts forest[n] of depth-first planar planted binary trees into breadth-first representation.

Original entry on oeis.org

1, 2, 4, 5, 3, 9, 10, 13, 14, 12, 6, 7, 8, 11, 23, 24, 27, 28, 26, 36, 37, 41, 42, 40, 32, 33, 35, 39, 15, 16, 18, 19, 17, 22, 25, 20, 21, 34, 38, 29, 30, 31, 65, 66, 69, 70, 68, 78, 79, 83, 84, 82, 74, 75, 77, 81, 106, 107, 111, 112, 110, 125, 126, 131, 132, 130
Offset: 1

Views

Author

Wouter Meeussen, May 04 2000

Keywords

Examples

			tree ( 1 (100) (10 ) ) becomes (1) (11)(00 0 ) thus (1 (1(100) 0) ) and is permuted from position 3 in forest[3] to position 5 by permutation {1,2,4,5,3}={{1},{2},{4,5,3}}
		

Crossrefs

Compare to the plot of A082364 and A072619.
Inverse of A070041. Cf. also A038774, A038775. If "expanded" produces A057117. Max cycle lengths: A057542.

Programs

  • Maple
    [seq(CatalanRank(inf,(btbf2df(binrev(CatalanUnrank(inf,j)),0,1)/2))+1,j=0..(binomial(2*inf,inf)/(inf+1))-1)]; (In practice, use a value like 6 instead of infinity).
    btbf2df := proc(nn,i,r) local n,j,c,x,y,w; n := nn; if(0 = (n mod 2)) then RETURN(0); fi; c := i; for j from 1 to r do c := c + (n mod 2); n := floor(n/2); od; w := 2*c; c := 0; for j from 1 to (2*i) do c := c + (n mod 2); n := floor(n/2); od; x := btbf2df(n,c,(w-(j-1))); y := btbf2df(floor(n/2),c+(n mod 2),(w-(j))); RETURN((2^(binwidth(x)+binwidth(y))) + (x * (2^(binwidth(y)))) + y); end;
    floor_log_2 := proc(n) local nn,i: nn := n; for i from -1 to n do if(0 = nn) then RETURN(i); fi: nn := floor(nn/2); od: end:
    binwidth := n -> (`if`((0 = n),1,floor_log_2(n)+1));
    binrev := proc(nn) local n,z; n := nn; z := 0; while(n <> 0) do z := 2*z + (n mod 2); n := floor(n/2); od; RETURN(z); end;
  • Mathematica
    bracket[ tree_ ] := (Flatten[ {tree, 0} ]/. 0->{0})//.{1, z___, 1, a_List, b_List, y___}:>{1, z, {1, a, b}, y}; widthfirst[ dectree_ ] := b2d[ Drop[ Flatten[ {Table[ Cases[ Level[ #, {k}, z ], A014486%20*)%20Ordering%5BReverse%5Bwidthfirst%20/@%20b2d%20/@%20wood%5B6%5D%5D%5D%20(*%20_Wouter%20Meeussen">Integer ], {k, Depth[ # ]-1} ] }/.z->List ], -1 ] ] & @(bracket@d2b[ dectree ]); (* uses functions in A014486 *) Ordering[Reverse[widthfirst /@ b2d /@ wood[6]]] (* _Wouter Meeussen, Aug 19 2025 *)

Extensions

Additional comments from Antti Karttunen, Aug 11 2000

A057543 Maximum cycle length (orbit size) in the rotation permutation of 2n non-crossing handshakes.

Original entry on oeis.org

1, 1, 2, 3, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124
Offset: 0

Views

Author

Antti Karttunen, Sep 07 2000

Keywords

Comments

That is, in permutations A057501 and A057502, the longest cycle among all cycles between the (A014138(n-2)+1)th and (A014138(n-1))th terms.

Crossrefs

Formula

a(0)=1, a(1)=1, a(2)=2, a(3)=3, and a(n)=2*n for n>=4.

Extensions

More terms from Sean A. Irvine, Jun 13 2022

A057544 Maximum cycle length (orbit size) in the rotation permutation of n+2 side polygon triangularizations.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 07 2000

Keywords

Comments

I.e., in permutations A057161 and A057162 (also A057503 and A057504), the longest cycle among all cycles between the (A014138(n-2)+1)-th and (A014138(n-1))-th terms.

Crossrefs

Programs

Formula

a(0)=1, a(1)=1, a(2)=2, a(n)=n+2.
From Chai Wah Wu, Jul 28 2022: (Start)
a(n) = 2*a(n-1) - a(n-2) for n > 4.
G.f.: (-2*x^4 + 2*x^3 + x^2 - x + 1)/(x - 1)^2. (End)

Extensions

More terms from Sean A. Irvine, Jun 13 2022

A065163 Maximal orbit size in the symmetric group partitioned by the upper records version of the Foata transform (i.e., a(n) is the maximum cycle length found in the corresponding permutations A065181-A065184 in range [0, n!-1]).

Original entry on oeis.org

1, 1, 3, 7, 25, 216, 963, 23435, 92225, 2729205, 17313348, 182553725, 4235194171
Offset: 1

Views

Author

Antti Karttunen, Oct 19 2001

Keywords

Comments

Note: the number of fixed terms in each successive range [0, n!-1] is given by A000045(n+1) (Fibonacci numbers) and the corresponding positions by A060112. (Foata transform fixes a permutation only if it is composed of disjoint adjacent transpositions.)
This version of the Foata transform is one of several. This map takes a permutation s in S_n with k cycles to a permutation t in S_n with k upper records, i.e., k indices i for which t(i) > max{t(j): j < i}. - Theodore Zhu, Aug 15 2014

Crossrefs

For the requisite Maple procedures see sequences A057502, A057542, A060117, A060125.

Programs

  • Maple
    FoataPermutationCycleCounts_Lengths_and_LCM := proc(upto_n) local u,n,a,b,i,f; a := []; b := []; f := 1; for i from 0 to upto_n! -1 do b := [op(b),1+PermRank3R(Foata(PermUnrank3R(i)))]; if((f - 1) = i) then a := [op(a),[CountCycles(b), CycleLengths1(b), CyclesLCM(b)]]; print (a); f := f*(nops(a)+1); fi; od; RETURN(a); end;
    lcmlist := proc(a) local z,e; z := 1; for e in a do z := ilcm(z,e); od; RETURN(z); end;
    CyclesLCM := b -> lcmlist(map(nops,convert(b,'disjcyc')));

Extensions

More terms from Theodore Zhu, Aug 15 2014

A038774 Cycle lengths of the permutation that converts the forest of depth-first planar planted binary trees into breadth-first representation.

Original entry on oeis.org

1, 1, 3, 4, 3, 2, 16, 8, 2, 2, 87, 3, 202, 25, 5, 4, 61, 607, 63, 165, 127, 12, 8, 10, 4, 5, 927, 1441, 283, 625, 91, 52, 8, 5, 4708, 592, 1890, 86, 3505, 482, 471, 34, 84, 17, 22, 25, 5, 9, 3, 1
Offset: 1

Views

Author

Wouter Meeussen, May 04 2000

Keywords

Examples

			The first 6 terms add up to 14=cat[4], so the cycle lengths of the permutation for forest[4] are {1, 1, 3, 4, 3, 2}. The sequence as given (50 terms) was generated on forest[10].
		

Crossrefs

Cf. A038775, A038776. Max cycle lengths: A057542.
Showing 1-5 of 5 results.