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-3 of 3 results.

A080300 Global ranking function for totally balanced binary sequences.

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

Antti Karttunen, Feb 21 2003

Keywords

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.

Crossrefs

Inverse function of A014486, i.e. a(A014486(n)) = n for all n. Cf. A080116, A215406, A213704, A209640.

Programs

  • Maple
    A080300 := n -> A080116(n)*A215406(n); # Untested (as of Aug 19 2012)
    A080300 := n -> `if`((0 = n) or (0 = A080116(n)),0, A014137(((A000523(n)+1)/2)-1)+A080301(n));
  • 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];
    a[n_] := A080116[n]*A215406[n] // Simplify;
    Table[a[n], {n, 0, 170}] (* Jean-François Alcover, Mar 05 2016 *)

Formula

a(n) = A080116(n)*A215406(n).
a(n) = 0 if n=0 or (A080116(n)=0), otherwise a(n) = A014137(((A000523(n)+1)/2)-1)+A080301(n)

A080119 Positions of A080118 in A014486.

Original entry on oeis.org

1, 2, 7, 33, 81, 74395, 8369196, 215802898, 414859094165, 520973680640109, 4064761999842441067, 517978450857911919447, 4255027826896017770661, 5222501054779098990032001033, 718000720375918750838217734094612383
Offset: 1

Views

Author

Antti Karttunen, Feb 11 2003

Keywords

Programs

Formula

a(n) = A215406(A080118(n)). - Peter Luschny, Aug 10 2012

A213704 Catalan Unranking function U(size,rank) for totally balanced binary strings (converted to decimal). Each row 'size' of an array lists all A000108(size) such items in standard lexicographic order, followed by an infinite number of zeros.

Original entry on oeis.org

0, 0, 2, 0, 0, 10, 0, 0, 12, 42, 0, 0, 0, 44, 170, 0, 0, 0, 50, 172, 682, 0, 0, 0, 52, 178, 684, 2730, 0, 0, 0, 56, 180, 690, 2732, 10922, 0, 0, 0, 0, 184, 692, 2738, 10924, 43690, 0, 0, 0, 0, 202, 696, 2740, 10930, 43692, 174762, 0, 0, 0, 0, 204, 714, 2744, 10932, 43698, 174764, 699050, 0
Offset: 0

Views

Author

Antti Karttunen, Aug 10 2012

Keywords

Comments

The Scheme-function CatalanUnrank has been adapted from Frank Ruskey's thesis. This gives essentially the same information as A014486 which can be obtained from this array by concatenating all A000108(s) nonzero terms from the beginning of each row s to one sequence.
See the comments and pictures at A014486 for more information.

Crossrefs

The leftmost column: A020988. For all n>1, A014486(n) = A213704bi(A072643(n),(n - A014137(A072643(n)-1))). Cf. A009766, A215406, A153250.

Programs

  • Scheme
    (define (A213704 n) (A213704bi (A002262 n) (A025581 n)))
    (define (A213704bi row col) (cond ((zero? row) 0) ((>= col (A000108 row)) 0) (else (CatalanUnrank row col))))
    (define (CatalanUnrank size rank) (let loop ((a 0) (m (-1+ size)) (y size) (rank rank) (c (A009766tr (-1+ size) size))) (if (negative? m) a (if (>= rank c) (loop (1+ (* 2 a)) m (-1+ y) (- rank c) (A009766tr m (-1+ y))) (loop (* 2 a) (-1+ m) y rank (A009766tr (-1+ m) y))))))
Showing 1-3 of 3 results.