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.

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

A072088 Permutation of natural numbers induced by the automorphism gt-bf->df (switch from the Breadth First to the Depth First coding for the general trees/parenthesizations) acting on the parenthesizations encoded by A014486.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 25 2002

Keywords

Comments

When restricted to the subset of plane binary trees, produces the automorphism A057117, with which this shares the property of "self-embeddability": each sub-permutation of the length A000108(n): 0; 1; 2,3; 4,5,6,7,8; 9,10,11,12,13,14,19,16,17,18,15,20,21,22; 23,24,25,26,27,28,33,30,31,32,29,34,35,36,37,51,38,56,60,42,47,44,45,46,53,48,49,50,39,41,43,54,61,40,57,58,59,52,55,62,63,64; starts with the same cycle-structure as the previous sub-permutation. (i.e. the terms from the first to the sixth are fixed, the 7th and 11th are transposed, etc.), thus allowing us to construct the permutation A072619 (A072621).

Crossrefs

Inverse permutation: A072089. Cf. also A014486, A057117, A072619.

A072620 Permutation of natural numbers obtained from the permutation A072089 (zero-based).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 10, 7, 8, 9, 6, 11, 12, 13, 14, 16, 28, 33, 29, 19, 30, 21, 22, 23, 20, 25, 26, 27, 15, 37, 24, 31, 38, 17, 34, 35, 36, 18, 32, 39, 40, 41, 42, 44, 47, 49, 48, 84, 112, 98, 103, 99, 85, 107, 87, 88, 56, 70, 89, 100, 90, 61, 91, 63, 64, 65, 62, 67, 68, 69, 57
Offset: 0

Views

Author

Antti Karttunen, Jun 25 2002

Keywords

Comments

See the comment at A072088.

Crossrefs

Compare to the plot of A070041.
A072620(n) = A072622(n+1)-1. Inverse permutation: A072619. Cf. also A072089, A070041.

A072621 Permutation of natural numbers obtained from the permutation A072088 (one-based).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 11, 8, 9, 10, 7, 12, 13, 14, 15, 29, 16, 34, 38, 20, 25, 22, 23, 24, 31, 26, 27, 28, 17, 19, 21, 32, 39, 18, 35, 36, 37, 30, 33, 40, 41, 42, 43, 85, 44, 99, 113, 45, 47, 46, 104, 108, 86, 118, 122, 127, 57, 71, 90, 76, 80, 62, 67, 64, 65, 66, 73, 68, 69, 70
Offset: 1

Views

Author

Antti Karttunen, Jun 25 2002

Keywords

Comments

See the comment at A072088.

Crossrefs

A072621(n) = A072619(n-1)+1. Inverse permutation: A072622. Cf. also A038776.
Showing 1-4 of 4 results.