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

A243753 Number A(n,k) of Dyck paths of semilength n avoiding the consecutive step pattern given by the binary expansion of k, where 1=U=(1,1) and 0=D=(1,-1); square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 0, 0, 0, 1, 1, 2, 1, 4, 1, 1, 0, 0, 0, 1, 1, 2, 4, 1, 9, 1, 1, 0, 0, 0, 1, 1, 2, 4, 9, 1, 21, 1, 1, 0, 0, 0, 1, 1, 1, 4, 9, 21, 1, 51, 1, 1, 0, 0, 0
Offset: 0

Views

Author

Alois P. Heinz, Jun 09 2014

Keywords

Examples

			Square array A(n,k) begins:
  1, 1, 1, 1, 1,   1, 1,   1,   1,    1, ...
  0, 0, 0, 1, 1,   1, 1,   1,   1,    1, ...
  0, 0, 0, 1, 1,   1, 1,   2,   2,    2, ...
  0, 0, 0, 1, 1,   2, 1,   4,   4,    4, ...
  0, 0, 0, 1, 1,   4, 1,   9,   9,    9, ...
  0, 0, 0, 1, 1,   9, 1,  21,  21,   23, ...
  0, 0, 0, 1, 1,  21, 1,  51,  51,   63, ...
  0, 0, 0, 1, 1,  51, 1, 127, 127,  178, ...
  0, 0, 0, 1, 1, 127, 1, 323, 323,  514, ...
  0, 0, 0, 1, 1, 323, 1, 835, 835, 1515, ...
		

Crossrefs

Columns give: 0, 1, 2: A000007, 3, 4, 6: A000012, 5: A001006(n-1) for n>0, 7, 8, 14: A001006, 9: A135307, 10: A078481 for n>0, 11, 13: A105633(n-1) for n>0, 12: A082582, 15, 16: A036765, 19, 27: A114465, 20, 24, 26: A157003, 21: A247333, 25: A187256(n-1) for n>0.
Main diagonal gives A243754 or column k=0 of A243752.

Programs

  • Maple
    A:= proc(n, k) option remember; local b, m, r, h;
          if k<2 then return `if`(n=0, 1, 0) fi;
          m:= iquo(k, 2, 'r'); h:= 2^ilog2(k); b:=
          proc(x, y, t) option remember; `if`(y<0 or y>x, 0, `if`(x=0, 1,
            `if`(t=m and r=1, 0, b(x-1, y+1, irem(2*t+1, h)))+
            `if`(t=m and r=0, 0, b(x-1, y-1, irem(2*t, h)))))
          end; forget(b);
          b(2*n, 0, 0)
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    A[n_, k_] := A[n, k] = Module[{b, m, r, h}, If[k<2, Return[If[n == 0, 1, 0]]]; {m, r} = QuotientRemainder[k, 2]; h = 2^Floor[Log[2, k]]; b[x_, y_, t_] := b[x, y, t] = If[y<0 || y>x, 0, If[x == 0, 1, If[t == m && r == 1, 0, b[x-1, y+1, Mod[2*t+1, h]]] + If[t == m && r == 0, 0, b[x-1, y-1, Mod[2*t, h]]]]]; b[2*n, 0, 0]]; Table[ Table[A[n, d-n], {n, 0, d}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Jan 27 2015, after Alois P. Heinz *)

A114464 Number of Dyck paths of semilength n having no ascents of length 2 that start at an even level.

Original entry on oeis.org

1, 1, 1, 2, 6, 18, 54, 166, 522, 1670, 5418, 17786, 58974, 197226, 664494, 2253390, 7685394, 26345230, 90721362, 313682098, 1088609142, 3790610306, 13239554790, 46371693174, 162835695258, 573160873750, 2021885799162, 7146955776554
Offset: 0

Views

Author

Emeric Deutsch, Nov 29 2005

Keywords

Comments

Column 0 of A114462.

Examples

			a(4)=6 because we have UDUDUDUD, UDUUUDDD, UUUDDDUD, UUUDUDDD, UUUDDUDD and UUUUDDDD, where U=(1,1), D=(1,-1).
		

Crossrefs

Programs

  • Maple
    G:=(1-z+3*z^2-z^3-(1-z)*sqrt((1-4*z+z^2)*(1+z^2)))/2/z: Gser:=series(G,z=0,33): 1,seq(coeff(Gser,z^n),n=1..30);
  • Mathematica
    CoefficientList[Series[(1-x+3*x^2-x^3-(1-x)*Sqrt[(1-4*x+x^2)*(1+x^2)])/2/x, {x, 0, 20}], x] (* Vaclav Kotesovec, Feb 13 2014 *)

Formula

G.f.=[1-z+3z^2-z^3-(1-z)sqrt((1-4z+z^2)(1+z^2))]/(2z).
G.f. 1+x/(1-x)c(x^2/(1-x)^4), c(x) the g.f. of A000108; a(n+1)=sum{k=0..floor(n/2), C(n+2k,4k)C(k)}; - Paul Barry, May 31 2006
Conjecture: (n+1)*a(n) +(-5*n+3)*a(n-1) +2*(3*n-7)*a(n-2) +2*(-3*n+11)*a(n-3) +(5*n-27)*a(n-4) +(-n+7)*a(n-5)=0. - R. J. Mathar, Nov 26 2012
Recurrence: (n-3)*(n+1)*a(n) = (4*n^2 - 14*n + 9)*a(n-1) - (2*n^2 - 10*n + 15)*a(n-2) + (4*n^2 - 26*n + 39)*a(n-3) - (n-6)*(n-2)*a(n-4). - Vaclav Kotesovec, Feb 13 2014
a(n) ~ sqrt(2*sqrt(3)-3) * (2+sqrt(3))^n / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Feb 13 2014

A114462 Triangle read by rows: T(n,k) is the number of Dyck paths of semilength n having k ascents of length 2 starting at an even level (0<=k<=floor(n/2)).

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 6, 7, 1, 18, 19, 5, 54, 59, 18, 1, 166, 191, 65, 7, 522, 631, 242, 34, 1, 1670, 2123, 906, 154, 9, 5418, 7247, 3395, 680, 55, 1, 17786, 25011, 12746, 2932, 300, 11, 58974, 87071, 47931, 12414, 1540, 81, 1, 197226, 305275, 180439, 51878, 7552
Offset: 0

Views

Author

Emeric Deutsch, Nov 29 2005

Keywords

Comments

Row n has 1+floor(n/2) terms. Row sums are the Catalan numbers (A000108). Sum(kT(n,k), k=0..floor(n/2)) = binomial(2n-3,n-1)-binomial(2n-4,n) = A077587(n-2) (n>=2). Column 0 yields A114464.

Examples

			T(4,1) = 7 because we have (UU)DDUDUD, UD(UU)DDUD, UDUD(UU)DD, (UU)DUDDUD,
UD(UU)DUDD, (UU)DUDUDD and (UU)DUUDDD, where U=(1,1), D=(1,-1) (the ascents of length 2 starting at an even level are shown between parentheses; note that the last path has an ascent of length 2 that starts at an odd level).
Triangle starts:
1;
1;
1,   1;
2,   3;
6,   7,  1;
18, 19,  5;
54, 59, 18, 1;
		

Crossrefs

Programs

  • Maple
    G:= 1/2/z*(3*z^2+2*z^3*t+1-z^3*t^2-3*z^2*t-z^3+t*z-z -sqrt(1+20*z^3*t-18*z^5*t^2+15*z^4*t^2+18*z^5*t+6*z^5*t^3-2*z^4*t^3-12*z^2*t -12*z^3 -6*z-24*z^4*t-8*z^3*t^2+z^6-6*z^5+11*z^4 +z^2*t^2+6*z^6*t^2 -4*z^6*t^3 -4*z^6*t+z^6*t^4+2*t*z +11*z^2)): Gser:=simplify(series(G,z=0,17)): P[0]:=1: for n from 1 to 14 do P[n]:=coeff(Gser,z^n) od: for n from 0 to 14 do seq(coeff(t*P[n],t^j),j=1..1+floor(n/2)) od; # yields sequence in triangular form
    # second Maple program:
    b:= proc(x, y, t) option remember; `if`(y<0 or y>x, 0, `if`(x=0,
          `if`(t=2, z, 1), expand(b(x-1, y-1, min(3, t+1))+
          `if`(t=2 and irem(y, 2)=0, z, 1)*b(x-1, y+1, 0))))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(2*n, 0$2)):
    seq(T(n), n=0..14);  # Alois P. Heinz, Mar 12 2014
  • Mathematica
    b[x_, y_, t_] := b[x, y, t] = If[y<0 || y>x, 0, If[x==0, If[t==2, z, 1], Expand[ b[x-1, y-1, Min[3, t+1]] + If[t==2 && Mod[y, 2]==0, z, 1]*b[x-1, y+1, 0]]]]; T[n_] := Function[{p}, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][b[2*n, 0, 0]]; Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Mar 31 2015, after Alois P. Heinz *)

Formula

G.f.: G(t,z) satisfies zG^2-(1-z+tz-3tz^2+3z^2-z^3-t^2z^3+2tz^3)G+1-z+z^2+tz-tz^2=0.

A114463 Triangle read by rows: T(n,k) is the number of Dyck paths of semilength n having k ascents of length 2 starting at an odd level (0<=k<=floor(n/2)-1 for n>=2; k=0 for n=0,1).

Original entry on oeis.org

1, 1, 2, 5, 13, 1, 36, 6, 105, 26, 1, 317, 104, 8, 982, 402, 45, 1, 3105, 1522, 225, 10, 9981, 5693, 1052, 69, 1, 32520, 21144, 4698, 412, 12, 107157, 78188, 20319, 2249, 98, 1, 356481, 288340, 85864, 11522, 679, 14, 1195662, 1061520, 356535, 56360, 4230
Offset: 0

Views

Author

Emeric Deutsch, Nov 29 2005

Keywords

Comments

Row n (n>=2) has floor(n/2) terms. Row sums are the Catalan numbers (A000108). Sum(kT(n,k),k=0..floor(n/2)-1)=binomial(2n-4,n) (A002694). Column 0 yields A114465.

Examples

			T(5,1) = 6 because we have UUD(UU)DUDDD, UUD(UU)DDUDD, UUD(UU)DDDUD,
UDUUD(UU)DDD, UUDUD(UU)DDD and UUUDD(UU)DDD, where U=(1,1), D=(1,-1) (the ascents of length 2 starting at an odd level are shown between parentheses; note that the fourth path has an ascent of length 2 that starts at an even level).
Triangle starts:
:  0 :    1;
:  1 :    1;
:  2 :    2;
:  3 :    5;
:  4 :   13,    1;
:  5 :   36,    6;
:  6 :  105,   26,    1;
:  7 :  317,  104,    8;
:  8 :  982,  402,   45,  1;
:  9 : 3105, 1522,  225, 10;
: 10 : 9981, 5693, 1052, 69, 1;
		

Crossrefs

Programs

  • Maple
    G:=-1/2*(1-z^2+z^2*t-sqrt((z^2*t-z^2+4*z-1)*(z^2*t-z^2-1)))/z/(-z^2+z^2*t+z-z*t-1): Gser:=simplify(series(G,z=0,18)): P[0]:=1: for n from 1 to 15 do P[n]:=coeff(Gser,z^n) od: 1; 1; for n from 2 to 15 do seq(coeff(t*P[n],t^j),j=1..floor(n/2)) od; # yields sequence in triangular form
    # second Maple program:
    b:= proc(x, y, t) option remember; `if`(y<0 or y>x, 0,
         `if`(x=0, 1, expand(b(x-1, y+1, [2, 2, 2, 5, 2][t])
          *`if`(t=5, z, 1) +b(x-1, y-1, [1, 3, 4, 1, 3][t]))))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(2*n, 0, 1)):
    seq(T(n), n=0..15);  # Alois P. Heinz, Jun 10 2014
  • Mathematica
    b[x_, y_, t_] := b[x, y, t] = If[y<0 || y>x, 0, If[x==0, 1, Expand[b[x-1, y+1, {2, 2, 2, 5, 2}[[t]]]*If[t==5, z, 1] + b[x-1, y-1, {1, 3, 4, 1, 3}[[t]]]]]]; T[n_] := Function[{p}, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][b[2*n, 0, 1]]; Table[T[n], {n, 0, 15}] // Flatten (* Jean-François Alcover, Mar 31 2015, after Alois P. Heinz *)

Formula

G.f.: G=G(t, z) satisfies z[(1-t)z^2-(1-t)z+1]G^2-[1-(1-t)z^2]G+1=0.

A215067 Number of Motzkin n-paths avoiding odd-numbered steps that are up steps.

Original entry on oeis.org

1, 1, 1, 2, 3, 6, 10, 21, 37, 80, 146, 322, 602, 1347, 2563, 5798, 11181, 25512, 49720, 114236, 224540, 518848, 1027038, 2384538, 4748042, 11068567, 22150519, 51817118, 104146733, 244370806, 493012682, 1159883685, 2347796965, 5536508864, 11239697816, 26560581688, 54061835288
Offset: 0

Views

Author

David Scambler, Aug 02 2012

Keywords

Comments

This sequence interleaves the counts of the closely related sequences A109081 and A106228.
a(n) is the number of (peakless) Motzkin paths of length n where every pair of matching up and down edges occupies positions of the same parity. Equivalently, the number of RNA secondary structures on n vertices where only vertices of the same parity can be matched. - Alexander Burstein, May 17 2021

Examples

			a(5) = 6: fUfFd, fUfDf, fUdUd, fUdFf, fFfUd, fFfFf showing odd-numbered steps in lower case.
		

Crossrefs

Programs

  • Maple
    b:= proc(x, y) option remember; `if`(y<0 or y>x, 0,
          `if`(x=0, 1, b(x-1, y) +b(x-1, y+1) +
          `if`(irem(x, 2)=1, 0, b(x-1, y-1)) ))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..40);  # Alois P. Heinz, Apr 04 2013
  • Mathematica
    f[n_,x_,y_]:=f[n,x,y] = If[x>n||y<0,0,If[x==n&&y==0,1, If[EvenQ[x],0,f[n,x+1,y+1]] +f[n,x+1,y-1] + f[n,x+1,y]]]; Table[f[n,0,0],{n,0,35}]
  • PARI
    {a(n)=polcoeff((1/x)*serreverse(x*(3+2*x+x^2 - sqrt((1+x^2)*(1+4*x+x^2)+x^2*O(x^n)))/(2*(1+x+x^2+x^2*O(x^n)))),n)} \\ Paul D. Hanna, Aug 02 2012
    
  • Sage
    from mpmath import mp
    mp.dps = 25; mp.pretty = True
    def A215067(n) :
        m = n%2; r = n//2 if n>0 else 1
        return r^(1-m)*mp.hyper([-r,1-r-2*m,1+r+m],[(3-m)/2,(4-m)/2],1/4)
    [int(A215067(i)) for i in (0..32)]  # Peter Luschny, Aug 03 2012

Formula

a(2*n) = Sum_{k=0..n} binomial(n+k-1,n-k) * binomial(n,k)/(n-k+1);
a(2*n+1) = Sum_{k=0..n} binomial(n+k+1,n-k) * binomial(n,k)/(n-k+1).
G.f.: (1/x)*Series_Reversion( x*(3+2*x+x^2 - sqrt((1+x^2)*(1+4*x+x^2)))/(2*(1+x+x^2)) ). - Paul D. Hanna, Aug 02 2012
G.f. satisfies: A(x) = G(x*A(x)) where G(x) = A(x/G(x)) = (3+2*x+x^2 + sqrt((1+x^2)*(1+4*x+x^2)))/4. - Paul D. Hanna, Aug 02 2012
G.f. satisfies: Series_Reversion(x*A(x)) = x - x^2*F(-x) where F(x) = g.f. of A114465. - Paul D. Hanna, Aug 02 2012
a(n) = 3_F_2([-r,1-r-2*m,1+r+m],[(3-m)/2,(4-m)/2],1/4)*r^(1-m) for n>0 where m = n mod 2 and r = floor(n/2). - Peter Luschny, Aug 03 2012
Showing 1-5 of 5 results.