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-10 of 18 results. Next

A122227 a(n) = A057548(A057117(n)).

Original entry on oeis.org

1, 3, 7, 8, 17, 18, 21, 22, 20, 45, 46, 49, 50, 48, 58, 59, 63, 64, 62, 54, 55, 57, 61, 129, 130, 133, 134, 132, 142, 143, 147, 148, 146, 138, 139, 141, 145, 170, 171, 175, 176, 174, 189, 190, 195, 196, 194, 184, 185, 188, 193, 157, 158, 161, 162, 160, 169, 173
Offset: 0

Views

Author

Antti Karttunen, Sep 14 2006

Keywords

Crossrefs

A057164 Self-inverse permutation of natural numbers induced by reflections of the rooted plane trees and mountain ranges encoded by A014486.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 18 2000

Keywords

Comments

CatalanRankGlobal given in A057117 and the other Maple procedures in A056539.
Composition with A057163 gives Donaghey's Map M (A057505/A057506).

Examples

			a(10)=14 and a(14)=10, A014486[10] = 172 (10101100 in binary), A014486[14] = 202 (11001010 in binary) and these encode the following mountain ranges (and the corresponding rooted plane trees), which are reflections of each other:
...../\___________/\
/\/\/__\_________/__\/\/\
...
...../...........\
..\|/.............\|/
		

Crossrefs

A057123(A057163(n)) = A057164(A057123(n)) for all n. Also the car/cdr-flipped conjugate of A069787, i.e., A057164(n) = A057163(A069787(A057163(n))). Fixed terms are given by A061856. Cf. also A057508, A069772.
Row 2 of tables A122287 and A122288.

Programs

  • Maple
    a(n) = CatalanRankGlobal(runcounts2binexp(reverse(binexp2runcounts(A014486[n])))) # i.e., reverse and complement the totally balanced binary sequences
  • PARI
    See Links section.

Formula

A057501 Signature-permutation of a Catalan Automorphism: Rotate non-crossing chords (handshake) arrangements; rotate the root position of general trees as encoded by A014486.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 03 2000; entry revised Jun 06 2014

Keywords

Comments

This is a permutation of natural numbers induced when "noncrossing handshakes", i.e., Stanley's interpretation (n), "n nonintersecting chords joining 2n points on the circumference of a circle", are rotated.
The same permutation is induced when the root position of plane trees (Stanley's interpretation (e)) is successively changed around the vertices.
For a good illustration how the rotation of the root vertex works, please see the Figure 6, "Rotation of an ordered rooted tree" in Torsten Mütze's paper (on page 24 in 20 May 2014 revision).
For yet another application of this permutation, please see the attached notes for A085197.
By "recursivizing" either the left or right hand side argument of A085201 in the formula, one ends either with A057161 or A057503. By "recursivizing" the both sides, one ends with A057505. - Antti Karttunen, Jun 06 2014

Crossrefs

Inverse: A057502.
Also, a "SPINE"-transform of A074680, and thus occurs as row 17 of A122203. (Also as row 65167 of A130403.)
Successive powers of this permutation, a^2(n) - a^6(n): A082315, A082317, A082319, A082321, A082323.
Cf. also A057548, A072771, A072772, A085201, A002995 (cycle counts), A057543 (max cycle lengths), A085197, A129599, A057517, A064638, A064640.

Programs

  • Maple
    map(CatalanRankGlobal,map(RotateHandshakes, A014486));
    RotateHandshakes := n -> pars2binexp(RotateHandshakesP(binexp2pars(n)));
    RotateHandshakesP := h -> `if`((0 = nops(h)),h,[op(car(h)),cdr(h)]); # This does the trick! In Lisp: (defun RotateHandshakesP (h) (append (car h) (list (cdr h))))
    car := proc(a) if 0 = nops(a) then ([]) else (op(1,a)): fi: end: # The name is from Lisp, takes the first element (head) of the list.
    cdr := proc(a) if 0 = nops(a) then ([]) else (a[2..nops(a)]): fi: end: # As well. Takes the rest (the tail) of the list.
    PeelNextBalSubSeq := proc(nn) local n,z,c; if(0 = nn) then RETURN(0); fi; n := nn; c := 0; z := 0; while(1 = 1) do z := 2*z + (n mod 2); c := c + (-1)^n; n := floor(n/2); if(c >= 0) then RETURN((z - 2^(floor_log_2(z)))/2); fi; od; end;
    RestBalSubSeq := proc(nn) local n,z,c; n := nn; c := 0; while(1 = 1) do c := c + (-1)^n; n := floor(n/2); if(c >= 0) then break; fi; od; z := 0; c := -1; while(1 = 1) do z := 2*z + (n mod 2); c := c + (-1)^n; n := floor(n/2); if(c >= 0) then RETURN(z/2); fi; od; end;
    pars2binexp := proc(p) local e,s,w,x; if(0 = nops(p)) then RETURN(0); fi; e := 0; for s in p do x := pars2binexp(s); w := floor_log_2(x); e := e * 2^(w+3) + 2^(w+2) + 2*x; od; RETURN(e); end;
    binexp2pars := proc(n) option remember; `if`((0 = n),[],binexp2parsR(binrev(n))); end;
    binexp2parsR := n -> [binexp2pars(PeelNextBalSubSeq(n)),op(binexp2pars(RestBalSubSeq(n)))];
    # Procedure CatalanRankGlobal given in A057117, other missing ones in A038776.

Formula

a(0) = 0, and for n>=1, a(n) = A085201(A072771(n), A057548(A072772(n))). [This formula reflects directly the given non-destructive Lisp/Scheme function: A085201 is a 2-ary function corresponding to 'append', A072771 and A072772 correspond to 'car' and 'cdr' (known also as first/rest or head/tail in some dialects), and A057548 corresponds to unary form of function 'list'].
As a composition of related permutations:
a(n) = A057509(A069770(n)).
a(n) = A057163(A069773(A057163(n))).
Invariance-identities:
A129599(a(n)) = A129599(n) holds for all n.

A083927 Inverse function of N -> N injection A057123.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 13 2003

Keywords

Comments

a(0)=0 because A057123(0)=0, but a(n) = 0 also for those n which do not occur as values of A057123. All positive natural numbers occur here once.
If g(n) = A083927(f(A057123(n))) then we can say that Catalan bijection g embeds into Catalan bijection f in scale n:2n, using the obvious binary tree -> general tree embedding. E.g. we have: A057163 = A083927(A057164(A057123(n))), A057117 = A083927(A072088(A057123(n))), A057118 = A083927(A072089(A057123(n))), A069770 = A083927(A072796(A057123(n))), A072797 = A083927(A072797(A057123(n))).

Crossrefs

a(A057123(n)) = n for all n. Cf. A083925-A083926, A083928-A083929, A083935.

A057161 Signature-permutation of a Catalan Automorphism: rotate one step counterclockwise the triangulations of polygons encoded by A014486.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 18 2000; entry revised Jun 06 2014

Keywords

Comments

This is a permutation of natural numbers induced when Euler's triangulation of convex polygons, encoded by the sequence A014486 in a straightforward way (via binary trees, cf. the illustration of the rotation of a triangulated pentagon, given in the Links section) are rotated counterclockwise.
The number of cycles in range [A014137(n-1)..A014138(n)] of this permutation is given by A001683(n+2), otherwise the same sequence as for Catalan bijections *A074679/*A074680, but shifted once left (for an explanation, see the related notes in OEIS Wiki).
E.g., in range [A014137(0)..A014138(1)] = [1,1] there is one cycle (as a(1)=1), in range [A014137(1)..A014138(2)] = [2,3] there is one cycle (as a(2)=3 and a(3)=2), in range [A014137(2)..A014138(3)] = [4,8] there is also one cycle (as a(4) = 7, a(7) = 6, a(6) = 5, a(5) = 8 and a(8) = 4), and in range [A014137(3)..A014138(4)] = [9,22] there are A001683(4+2) = 4 cycles.
From the recursive forms of A057161 and A057503 it is seen that both can be viewed as a convergent limits of a process where either the left or right side argument of A085201 in formula for A057501 is "iteratively recursivized", and on the other hand, both of these can then in turn be made to converge towards A057505 by the same method, when the other side of the formula is also "recursivized".

Crossrefs

Inverse: A057162.
Also, a "SPINE"-transform of A069774, and thus occurs as row 12 of A130403.
Other related permutations: A057163, A057164, A057501, A057504, A057505.
Cf. A001683 (cycle counts), A057544 (max cycle lengths).

Programs

  • Maple
    a(n) = CatalanRankGlobal(RotateTriangularization(A014486[n]))
    CatalanRankGlobal given in A057117 and the other Maple procedures in A038776.
    NextSubBinTree := proc(nn) local n,z,c; n := nn; c := 0; z := 0; while(c < 1) do z := 2*z + (n mod 2); c := c + (-1)^n; n := floor(n/2); od; RETURN(z); end;
    BinTreeLeftBranch := n -> NextSubBinTree(floor(n/2));
    BinTreeRightBranch := n -> NextSubBinTree(floor(n/(2^(1+binwidth(BinTreeLeftBranch(n))))));
    RotateTriangularization := proc(nn) local n,s,z,w; n := binrev(nn); z := 0; w := 0; while(1 = (n mod 2)) do s := BinTreeRightBranch(n); z := z + (2^w)*s; w := w + binwidth(s); z := z + (2^w); w := w + 1; n := floor(n/2); od; RETURN(z); end;

Formula

a(0) = 0, and for n>=1, a(n) = A085201(a(A072771(n)), A057548(A072772(n))). [This formula reflects the S-expression implementation given first in the Program section: A085201 is a 2-ary function corresponding to 'append', A072771 and A072772 correspond to 'car' and 'cdr' (known also as first/rest or head/tail in some languages), and A057548 corresponds to unary form of function 'list'.]
As a composition of related permutations:
a(n) = A069767(A069769(n)).
a(n) = A057163(A057162(A057163(n))).
a(n) = A057164(A057504(A057164(n))). [For a proof, see pp. 53-54 in the "Introductory survey ..." draft]

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

A057118 Permutation of natural numbers induced by the automorphism df->bf (switch from the Depth First to the Breadth First coding for the binary trees) acting on the planar binary trees encoded by A014486.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 11 2000

Keywords

Crossrefs

Restriction of the automorphism A072089 to the plane binary trees. Being self-embeddable, this allows us also to form the permutation A070041. Inverse permutation: A057117.

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.

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.

A061856 The positions of the terms of A061855 in the sequence A014486, terms fixed by the permutation A057164.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 8, 9, 11, 15, 17, 21, 22, 23, 30, 33, 38, 45, 48, 55, 58, 63, 64, 65, 70, 81, 86, 98, 102, 108, 113, 124, 129, 141, 145, 153, 158, 170, 174, 185, 189, 195, 196, 197, 216, 225, 241, 260, 269, 291, 300, 318, 323, 330, 349, 358, 374, 393, 402, 424, 433
Offset: 0

Views

Author

Antti Karttunen, May 11 2001

Keywords

Crossrefs

Cf. A061855, A057164, A057117 (CatalanRankGlobal)

Programs

  • Maple
    map(CatalanRankGlobal, A061855);
Showing 1-10 of 18 results. Next