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.
%I A080300 #21 Mar 05 2016 05:31:40 %S A080300 0,0,1,0,0,0,0,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, %T A080300 0,0,0,0,0,0,0,0,4,0,5,0,0,0,0,0,6,0,7,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0, %U A080300 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 %N A080300 Global ranking function for totally balanced binary sequences. %C A080300 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. %H A080300 Antti Karttunen, <a href="/A080300/b080300.txt">Table of n, a(n) for n = 0..992</a> %H A080300 A. Karttunen, <a href="http://oeis.org/wiki/Catalan_ranking_and_unranking_functions">Catalan ranking and unranking functions</a>, OEIS Wiki. %H A080300 Various authors, <a href="http://oeis.org/wiki/Source_code_for_Catalan_ranking_and_unranking_functions">Source code for Catalan ranking and unranking functions</a> (in various programming languages), OEIS Wiki. %F A080300 a(n) = A080116(n)*A215406(n). %F A080300 a(n) = 0 if n=0 or (A080116(n)=0), otherwise a(n) = A014137(((A000523(n)+1)/2)-1)+A080301(n) %p A080300 A080300 := n -> A080116(n)*A215406(n); # Untested (as of Aug 19 2012) %p A080300 A080300 := n -> `if`((0 = n) or (0 = A080116(n)),0, A014137(((A000523(n)+1)/2)-1)+A080301(n)); %t A080300 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]]]; %t A080300 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]; %t A080300 a[n_] := A080116[n]*A215406[n] // Simplify; %t A080300 Table[a[n], {n, 0, 170}] (* _Jean-François Alcover_, Mar 05 2016 *) %o A080300 (See the Source code... page at OEIS Wiki! Please add your code there, if possible.) %Y A080300 Inverse function of A014486, i.e. a(A014486(n)) = n for all n. Cf. A080116, A215406, A213704, A209640. %K A080300 nonn %O A080300 0,11 %A A080300 _Antti Karttunen_, Feb 21 2003