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
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, ...
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.
Cf.
A242450,
A243827,
A243828,
A243829,
A243830,
A243831,
A243832,
A243833,
A243834,
A243835,
A243836.
-
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);
-
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
a(4)=6 because we have UDUDUDUD, UDUUUDDD, UUUDDDUD, UUUDUDDD, UUUDDUDD and UUUUDDDD, where U=(1,1), D=(1,-1).
-
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);
-
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 *)
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
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;
-
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
-
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 *)
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
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;
-
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
-
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 *)
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
a(5) = 6: fUfFd, fUfDf, fUdUd, fUdFf, fFfUd, fFfFf showing odd-numbered steps in lower case.
-
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
-
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}]
-
{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
-
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
Showing 1-5 of 5 results.
Comments