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

A082356 Permutation of natural numbers induced by Catalan Automorphism *A082356 acting on the parenthesizations encoded by A014486/A063171.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 17 2003

Keywords

Comments

This bijection maps between the "standard" ordering of binary trees as encoded by A014486 and "variant B quaternary encoding" as explained in the sequence A085184.

Crossrefs

Inverse of A082355. a(n) = A057163(A082358(n)). a(n) = A082364(A082853(n))+A082852(n). Cf. also A082351-A082352, A082357-A082358.
Differs from A057117 first time at n=56: a(56)=42, while A057117(56)=44.

A082363 Permutation of natural numbers induced by the contraction of Catalan bijection signature-permutation A082355.

Original entry on oeis.org

0, 1, 4, 2, 3, 10, 11, 12, 5, 6, 13, 9, 7, 8, 28, 29, 32, 30, 31, 33, 34, 35, 14, 15, 36, 18, 16, 17, 37, 38, 41, 24, 25, 39, 26, 19, 20, 40, 27, 23, 21, 22, 84, 85, 88, 86, 87, 94, 95, 96, 89, 90, 97, 93, 91, 92, 98, 99, 102, 100, 101, 103, 104, 105, 42, 43, 106, 46, 44, 45
Offset: 0

Views

Author

Antti Karttunen, Apr 17 2003

Keywords

Crossrefs

Compare to the plot of A070041.
Inverse of A082364. Cf. also A082361-A082362.

Formula

a(n) = A082853(A082355(A081291(n))).

A082361 Permutation of natural numbers induced by the contraction of Catalan bijection signature-permutation A082351.

Original entry on oeis.org

0, 1, 4, 2, 3, 10, 11, 12, 5, 6, 13, 7, 8, 9, 28, 29, 30, 31, 32, 33, 34, 35, 14, 15, 36, 16, 17, 18, 37, 38, 39, 19, 20, 40, 21, 22, 23, 41, 24, 25, 26, 27, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 42, 43, 106, 44, 45, 46
Offset: 0

Views

Author

Antti Karttunen, Apr 17 2003

Keywords

Crossrefs

Inverse of A082362. Cf. also A082363-A082364.

Formula

a(n) = A082853(A082351(A081291(n))).

A082362 Permutation of natural numbers induced by the contraction of Catalan bijection signature-permutation A082352.

Original entry on oeis.org

0, 1, 3, 4, 2, 8, 9, 11, 12, 13, 5, 6, 7, 10, 22, 23, 25, 26, 27, 31, 32, 34, 35, 36, 38, 39, 40, 41, 14, 15, 16, 17, 18, 19, 20, 21, 24, 28, 29, 30, 33, 37, 64, 65, 67, 68, 69, 73, 74, 76, 77, 78, 80, 81, 82, 83, 92, 93, 95, 96, 97, 101, 102, 104, 105, 106, 108, 109, 110, 111
Offset: 0

Views

Author

Antti Karttunen, Apr 17 2003

Keywords

Crossrefs

Inverse of A082361. Cf. also A082363-A082364.

Formula

a(n) = A082853(A082352(A081291(n))).
Showing 1-5 of 5 results.