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.

A127365 Signed repeated natural numbers.

Original entry on oeis.org

0, 0, -1, -1, 2, 2, -3, -3, 4, 4, -5, -5, 6, 6, -7, -7, 8, 8, -9, -9, 10, 10, -11, -11, 12, 12, -13, -13, 14, 14, -15, -15, 16, 16, -17, -17, 18, 18, -19, -19, 20, 20, -21, -21, 22, 22, -23, -23, 24, 24, -25, -25, 26, 26, -27, -27, 28, 28, -29, -29, 30, 30, -31, -31
Offset: 0

Views

Author

Paul Barry, Jan 11 2007

Keywords

Comments

Hankel transform of A093387.

Crossrefs

Programs

Formula

G.f.: -x^2*(1+x)/(1+x^2)^2.
a(n) = floor(n/2)*(sin(n*Pi/2) + cos(n*Pi/2)).
a(n) = floor(n/2)*(-1)^floor(n/2) = A004526(n)*(-1)^A004526(n). - Wesley Ivan Hurt, Dec 10 2013
E.g.f.: (x*cos(x) - (1 + x)*sin(x))/2. - Stefano Spezia, Jul 14 2024

A094779 Let 2^k = smallest power of 2 >= binomial(n,[n/2]); a(n) = 2^k - binomial(n,[n/2]).

Original entry on oeis.org

0, 0, 0, 1, 2, 6, 12, 29, 58, 2, 4, 50, 100, 332, 664, 1757, 3514, 8458, 16916, 38694, 77388, 171572, 343144, 745074, 1490148, 3188308, 6376616, 13496132, 26992264, 56658968, 113317936, 236330717, 472661434, 980680538, 1961361076, 4052366942, 8104733884
Offset: 0

Views

Author

N. J. A. Sloane, Jun 10 2004

Keywords

Comments

Suggested by reading the Knuth article.
a(n+1) < a(n) for n = 8, 40, 162, 650... - Ivan Neretin, Jun 25 2015

Examples

			C(30,15) = 155117520; 2^28 = 268435456; difference is 113317936.
		

References

  • D. E. Knuth, Efficient balanced codes, IEEE Trans. Inform. Theory, 32 (No. 1, 1986), 51-53.

Crossrefs

Programs

  • Mathematica
    Table[-(b = Binomial[n, Quotient[n, 2]]) + 2^Ceiling[Log2[b]], {n, 0, 36}] (* Ivan Neretin, Jun 25 2015 *)

A094780 Let 2^k = smallest power of 2 >= binomial(2n,n); a(n) = 2^k - binomial(2n,n).

Original entry on oeis.org

0, 0, 2, 12, 58, 4, 100, 664, 3514, 16916, 77388, 343144, 1490148, 6376616, 26992264, 113317936, 472661434, 1961361076, 8104733884, 33374212936, 137031378124, 11497939448, 94924291832, 562662294608, 2936768405732, 14326881917576, 67031420473208, 304860388037136
Offset: 0

Views

Author

N. J. A. Sloane, Jun 10 2004

Keywords

Comments

Suggested by reading the Knuth article.

Examples

			C(30,15) = 155117520; 2^28 = 268435456; difference is 113317936.
k = 0, 1, 3, 5, 7, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, ... - _R. J. Mathar_, Nov 15 2019
		

References

  • D. E. Knuth, Efficient balanced codes, IEEE Trans. Inform. Theory, 32 (No. 1, 1986), 51-53.

Crossrefs

Programs

  • Maple
    A094780 := proc(n)
        local cb,k ;
        cb := binomial(2*n,n) ;
        k := ceil(log[2](cb)) ;
        2^k-cb ;
    end proc:
    seq(A094780(n),n=0..10); # R. J. Mathar, Nov 15 2019

A140659 a(n) = floor(A140657(n+2)/10).

Original entry on oeis.org

0, 0, 1, 2, 6, 12, 25, 50, 102, 204, 409, 818, 1638, 3276, 6553, 13106, 26214, 52428, 104857, 209714, 419430, 838860, 1677721, 3355442, 6710886, 13421772, 26843545, 53687090, 107374182, 214748364, 429496729, 858993458, 1717986918, 3435973836
Offset: 0

Views

Author

Paul Curtz, Jul 10 2008

Keywords

Crossrefs

Cf. A093387.

Programs

  • Mathematica
    a[ n_] := If[n < 2, 0, 2 a[n - 1] + If[ EvenQ[n], Mod[n/2, 2, 1], 0]]; (* Michael Somos, Mar 02 2014 *)
  • PARI
    f(n) = 2^n+3*(-1)^n; \\ A140657
    a(n) = f(n+2)\10; \\ Michel Marcus, Sep 08 2019

Formula

a(2n+2) = 4*a(2n)+A000034(n).
a(2n+1) = 2*a(2n).

Extensions

Edited and extended by R. J. Mathar, Jul 29 2008
Name corrected by Michel Marcus, Sep 08 2019

A191310 Triangle read by rows: T(n,k) is the number of dispersed Dyck paths (i.e., Motzkin paths with no (1,0) steps at positive heights) of length n having k up-steps starting at level 0.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 6, 3, 1, 10, 8, 1, 1, 14, 16, 4, 1, 23, 32, 13, 1, 1, 32, 56, 32, 5, 1, 55, 102, 74, 19, 1, 1, 78, 170, 152, 55, 6, 1, 143, 302, 307, 144, 26, 1, 1, 208, 498, 580, 336, 86, 7, 1, 405, 890, 1102, 748, 251, 34, 1, 1, 602, 1478, 2004, 1564, 652, 126, 8, 1, 1228, 2691, 3714, 3200, 1587, 405, 43, 1
Offset: 0

Views

Author

Emeric Deutsch, May 30 2011

Keywords

Comments

Row n has 1 + floor(n/2) entries.
Sum of entries in row n is binomial(n, floor(n/2)) = A001405(n).
Sum_{k>=0} k*T(n,k) = A093387(n+1).

Examples

			T(5,2)=3 because we have HUDUD, UDHUD, and UDUDH, where U=(1,1), D=(1,-1), H=(1,0).
Triangle starts:
  1;
  1;
  1,  1;
  1,  2;
  1,  4,  1;
  1,  6,  3;
  1, 10,  8,  1;
  1, 14, 16,  4;
  1, 23, 32, 13,  1;
		

Crossrefs

Programs

  • Maple
    G := 2/(2-2*z-t*(1-sqrt(1-4*z^2))): Gser := simplify(series(G, z = 0, 20)): for n from 0 to 16 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 0 to 16 do seq(coeff(P[n], t, k), k = 0 .. floor((1/2)*n)) end do; # yields sequence in triangular form

Formula

G.f.: G(t,z) = 2/(2-2*z-t*(1-sqrt(1-4*z^2))).

A191312 Triangle read by rows: T(n,k) is the number of dispersed Dyck paths (i.e., Motzkin paths with no (1,0) steps at positive heights) of length n having abscissa of the first return to the horizontal axis equal to k (assumed to be 0 if there are no such returns).

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 2, 1, 2, 1, 0, 3, 2, 2, 2, 1, 0, 6, 3, 4, 2, 4, 1, 0, 10, 6, 6, 4, 4, 4, 1, 0, 20, 10, 12, 6, 8, 4, 9, 1, 0, 35, 20, 20, 12, 12, 8, 9, 9, 1, 0, 70, 35, 40, 20, 24, 12, 18, 9, 23, 1, 0, 126, 70, 70, 40, 40, 24, 27, 18, 23, 23, 1, 0, 252, 126, 140, 70, 80, 40, 54, 27, 46, 23, 65
Offset: 0

Views

Author

Emeric Deutsch, May 30 2011

Keywords

Comments

Sum of entries in row n is binomial(n, floor(n/2)) = A001405(n).
Sum_{k>=0} k*T(n,k) = A093387(n+1).

Examples

			T(5,3)=2 because we have HUDHH and HUDUD, where U=(1,1), D=(1,-1), H=(1,0).
Triangle starts:
  1;
  1, 0;
  1, 0, 1;
  1, 0, 1, 1;
  1, 0, 2, 1, 2;
  1, 0, 3, 2, 2, 2;
  1, 0, 6, 3, 4, 2, 4;
		

Crossrefs

Programs

  • Maple
    c := proc (j) options operator, arrow: binomial(2*j, j)/(j+1) end proc: T := proc (n, k) if n < k then 0 elif k = 0 then 1 elif k = 1 then 0 else binomial(n-k, floor((1/2)*n-(1/2)*k))*(sum(c(j), j = 0 .. floor((1/2)*k)-1)) end if end proc: for n from 0 to 12 do seq(T(n, k), k = 0 .. n) end do; # yields sequence in triangular form
    G := (1-t*z+t^2*z^2*g*C-t^2*z^3*g*C)/((1-z)*(1-t*z)): g := 2/(1-2*z+sqrt(1-4*z^2)): C := ((1-sqrt(1-4*t^2*z^2))*1/2)/(t^2*z^2): Gser := simplify(series(G, z = 0, 15)): for n from 0 to 12 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 0 to 12 do seq(coeff(P[n], t, k), k = 0 .. n) end do; # yields sequence in triangular form
  • Mathematica
    c[j_] := Binomial[2j, j]/(j+1);
    T[n_, k_] := Which[n < k, 0, k == 0, 1, k == 1, 0, True, Binomial[n-k, Floor[(n-k)/2]]*(Sum[c[j], {j, 0, Floor[k/2]-1}])];
    Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 22 2024, after first Maple program *)

Formula

T(n,0)=1; T(n,1)=0;
T(n,k) = binomial(n-k, floor((n-k)/2))*Sum_{j=0..floor(k/2)-1} c(j), where 2<=k<=n and c(j) = binomial(2*j,j)/(j+1) are the Catalan numbers.
G.f.: G(t,z) = 1/(1-z)+(1-sqrt(1-4*t^2*z^2))/((1-t*z)*(1-2*z+sqrt(1-4*z^2))).
For k>=1, g.f. of column 2k is b_{k-1}*z^{2k}*g and of column 2k+1 is b_{k-1}*z^{2*k+1}*g, where g = 2/(1-2*z+sqrt(1-4*z^2)) and b(k) = Sum_{j=0..k-1} c(j) with c(j) = binomial(2*j,j)/(j+1) = A000108(j) (the Catalan numbers).

A191320 Triangle read by rows: T(n,k) is the number of dispersed Dyck paths of length n (i.e., Motzkin paths of length n with no (1,0) steps at positive heights) with k HUs, where U=(1,1) and H=(1,0).

Original entry on oeis.org

1, 1, 2, 2, 1, 4, 2, 4, 6, 9, 10, 1, 9, 23, 3, 23, 36, 11, 23, 77, 25, 1, 65, 118, 65, 4, 65, 249, 131, 17, 197, 380, 298, 48, 1, 197, 808, 566, 140, 5, 626, 1236, 1210, 336, 24, 626, 2665, 2230, 833, 80, 1, 2056, 4094, 4627, 1828, 259, 6, 2056, 8955, 8401, 4155, 711, 32, 6918, 13816, 17192, 8648, 1923, 122, 1
Offset: 0

Views

Author

Emeric Deutsch, Jun 01 2011

Keywords

Comments

Row n has 1 + floor(n/3) entries.
Sum of entries in row n is binomial(n,floor(n/2)) = A001405(n).
T(2*n,0) = T(2*n+1,0) = A014137(n) (partial sums of the Catalan numbers).
Sum_{k>=0}k*T(n,k) = A093387(n).

Examples

			T(7,2)=3 because we have HHUDHUD, HUDHHUD, and HUDHUDH, where U=(1,1), D=(1,-1), H=(1,0).
Triangle starts:
   1;
   1;
   2;
   2,  1;
   4,  2;
   4,  6;
   9, 10,  1;
   9, 23,  3;
  23, 36, 11;
		

Crossrefs

Programs

  • Maple
    G := 2/(1-z-t*z+(1-z+t*z)*sqrt(1-4*z^2)): Gser := simplify(series(G, z = 0, 20)): for n from 0 to 18 do P[n] := sort(expand(coeff(Gser, z, n))) end do: for n from 0 to 18 do seq(coeff(P[n], t, k), k = 0 .. floor((1/3)*n)) end do; # yields sequence in triangular form

Formula

G.f.: G(t,z) = 2/(1-z-t*z+(1-z+t*z)*sqrt(1-4*z^2)).
Showing 1-7 of 7 results.