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

A080321 a(n) = A080301(A080318(n)).

Original entry on oeis.org

0, 4, 428, 58747, 1758473969, 340760636747, 14410746502617904, 673020037180959760871, 1736622037158911219053381734718, 400539731185759177060380684246324
Offset: 0

Views

Author

Antti Karttunen, Mar 02 2003

Keywords

Crossrefs

Cf. A080320.

A080271 a(n) = A080301(A080268(n)).

Original entry on oeis.org

0, 4, 39, 4157, 48951, 7810096, 1396038023, 53725275266610, 771558836472208, 162485296061436675, 34997250890683907797, 1707178675072552289362060, 384389569381056309586675602, 20058720841018817533793283102645
Offset: 0

Views

Author

Antti Karttunen, Mar 02 2003

Keywords

Crossrefs

Cf. A080270.

A080296 a(n) = A080301(A080293(n)).

Original entry on oeis.org

0, 2, 280, 47104, 1552115753, 320620847201, 14010400861700086, 666566814219424468355, 1738670860867061382977091021290, 403468080959285491446589623771973
Offset: 0

Views

Author

Antti Karttunen, Mar 02 2003

Keywords

Crossrefs

Cf. A080295.

A080976 a(n) = A080301(A080973(n)).

Original entry on oeis.org

0, 3, 318, 49497, 1593176614, 306347668831, 13663408341818193, 657273036441106021420, 1725515775006035094342654787041, 397951747550111200113555298627327
Offset: 0

Views

Author

Antti Karttunen, Mar 02 2003

Keywords

Crossrefs

Cf. A080975.

A080266 a(n) = A080301(A080263(n)).

Original entry on oeis.org

0, 2, 28, 3995, 53032, 9218158, 1716408828, 68406706423034, 993609159645474, 211483814340246174, 45849905806140642231, 2254554272777258549734599, 509234594705250632023415288, 26692711238971831653512953923634
Offset: 0

Views

Author

Antti Karttunen, Mar 02 2003

Keywords

Crossrefs

Cf. A080265.

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)

A080116 Characteristic function of A014486. a(n) = 1 if n's binary expansion is totally balanced, otherwise zero.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 11 2003

Keywords

Comments

a(n) = 1 if the binary representation of n forms a valid Dyck path, or equally, a well-formed parenthesization when 1's are converted to left and 0's to right parentheses (that is, when A007088(n) is in A063171), and 0 otherwise. - Antti Karttunen, Aug 23 2019

Examples

			0 stands for an empty parenthesization, thus a(0) = 1.
2 has binary expansion "10", which corresponds with "()", thus a(2) = 1.
3 has binary expansion "11", but "((" is not a well-formed parenthesization, thus a(3) = 0.
10 has binary expansion "1010", corresponding with a well-formed parenthesization "()()", thus a(10) = 1.
38 has binary expansion "100110", but "())(()" is not a well-formed parenthesization, thus a(38) = 0.
		

Crossrefs

Programs

  • Maple
    A080116 := proc(n) local c,lev; lev := 0; c := n; while(c > 0) do lev := lev + (-1)^c; c := floor(c/2); if(lev < 0) then RETURN(0); fi; od; if(lev > 0) then RETURN(0); else RETURN(1); fi; end;
  • Mathematica
    A080116[n_] := (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]]); Table[A080116[n], {n, 0, 104}] (* Jean-François Alcover, Jul 24 2013, translated from Maple *)
  • PARI
    A080116(n) = { my(k=0); while(n, k += (-1)^n; n >>= 1; if(k<0, return(0))); (0==k); }; \\ Antti Karttunen, Aug 23 2019
  • Sage
    def A080116(n) :
        lev = 0
        while n > 0 :
            lev += (-1)^n
            if lev < 0: return 0
            n = n//2
        return 0 if lev > 0 else 1
    [A080116(n) for n in (0..104)] # Peter Luschny, Aug 09 2012
    

Extensions

Examples added by Antti Karttunen, Aug 23 2019
Showing 1-7 of 7 results.