login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A080301 Local ranking function for totally balanced binary sequences: if n's binary expansion is totally balanced (A080116(n)=1), then a(n) is its zero-based position among A000108((A000523(n)+1)/2) lexicographically ordered totally balanced binary sequences of the same width, otherwise -1. 7
0, -1, 0, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, -1, -1, -1, -1, 2, -1, 3, -1, -1, -1, 4, -1, -1, -1, -1 (list; graph; refs; listen; history; internal format)
OFFSET

0,51

COMMENTS

Maple procedure CatalanRank is adapted from the algorithm 3.23 of the CAGES book.

LINKS

D. L. Kreher and D. R. Stinson, Combinatorial Algorithms, Generation, Enumeration and Search, CRC Press, 1998.

EXAMPLE

We have Cat(0)=1 totally balanced binary sequences of length 2*0: 0, thus a(0)=0, Cat(1)=1 of length 2*1: 10, thus a(2)=0, Cat(2)=2 of length 2*2: 1010 (= 10.) and 1100 (= 12.), thus a(10)=0 and a(12)=1, plus altogether Cat(3)=5 totally balanced binary sequences of length 2*3: 101010 (= 42), 101100 (= 44), 110010 (= 50), 110100 (= 52), 111000 (= 56), thus a(42)=0, a(44)=1, a(50)=2, a(52)=3 and a(56)=4. Et cetera.

MAPLE

A080301 := n -> `if`(0 = A080116(n), -1, CatalanRank((A000523(n)+1)/2, n));

CatalanRank := proc(n, aa) local y, r, lo, a; a := aa; r := 0; y := -1; lo := 0; while (a > 0) do if(0 = (a mod 2)) then r := r+1; lo := lo + A009766(r, y); else y := y+1; fi; a := floor(a/2); od; RETURN((binomial(2*n, n)/(n+1))-(lo+1)); end;

CROSSREFS

Used to compute A080300. Cf. A009766, A000523.

Sequence in context: A051794 A110969 A006083 * A057021 A152443 A119804

Adjacent sequences:  A080298 A080299 A080300 * A080302 A080303 A080304

KEYWORD

sign

AUTHOR

Antti Karttunen (my_firstname.my_surname(AT)iki.fi) Feb 21 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 14 20:10 EST 2012. Contains 205663 sequences.