OFFSET
0,11
COMMENTS
Note: the next nonzero value occurs at a(170)=9, as 170 = 10101010 is the lexicographically earliest totally balanced binary sequence of length 2*4.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..992
A. Karttunen, Catalan ranking and unranking functions, OEIS Wiki.
Various authors, Source code for Catalan ranking and unranking functions (in various programming languages), OEIS Wiki.
FORMULA
MAPLE
MATHEMATICA
A080116[n_] := Module[{lev = 0, c = n}, While[c > 0, lev = lev + (-1)^c; c = Floor[c/2]; If[lev<0, Return[0]]]; If[lev>0, Return[0], Return[1]]];
A215406[n_] := Module[{m, d, a, y, t, x, u, v}, m = Quotient[Length[d = IntegerDigits[n, 2]], 2]; a = FromDigits[Reverse[d], 2]; y = 0; t = 1; For[x = 0, x <= 2*m - 2, x++, If[Mod[a, 2] == 1, y++, u = 2*m - x; v = m - Quotient[x + y, 2] - 1; t = t - Binomial[u - 1, v - 1] + Binomial[u - 1, v]; y--]; a = Quotient[a, 2]]; (1 - I*Sqrt[3])/2 - 4^(m + 1)*Gamma[m + 3/2]*Hypergeometric2F1[1, m + 3/2, m + 3, 4]/(Sqrt[Pi]*Gamma[m + 3]) -t];
Table[a[n], {n, 0, 170}] (* Jean-François Alcover, Mar 05 2016 *)
PROG
(See the Source code... page at OEIS Wiki! Please add your code there, if possible.)
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 21 2003
STATUS
approved