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 *)
A216604
G.f. satisfies: A(x) = (1 + x*(1-x)*A(x)) * (1 + x^2*A(x)).
Original entry on oeis.org
1, 1, 1, 2, 3, 4, 7, 12, 19, 33, 59, 102, 181, 329, 593, 1076, 1979, 3643, 6723, 12494, 23289, 43498, 81557, 153356, 288925, 545687, 1032997, 1958978, 3721819, 7083716, 13503311, 25778612, 49283755, 94345179, 180830195, 347006694, 666636809, 1282024484, 2467964693
Offset: 0
G.f.: A(x) = 1 + x + x^2 + 2*x^3 + 3*x^4 + 4*x^5 + 7*x^6 + 12*x^7 + 19*x^8 + ...
The logarithm of the g.f. begins:
log(A(x)) = ((1-x) + x)*x + ((1-x)^2 + 2^2*x*(1-x) + x^2)*x^2/2 +
((1-x)^3 + 3^2*x*(1-x)^2 + 3^2*x^2*(1-x) + x^3)*x^3/3 +
((1-x)^4 + 4^2*x*(1-x)^3 + 6^2*x^2*(1-x)^2 + 4^2*x^3*(1-x) + x^4)*x^4/4 +
((1-x)^5 + 5^2*x*(1-x)^4 + 10^2*x^2*(1-x)^3 + 10^2*x^3*(1-x)^2 + 5^2*x^4*(1-x) + x^5)*x^5/5 + ...
Explicitly,
log(A(x)) = x + x^2/2 + 4*x^3/3 + 5*x^4/4 + 6*x^5/5 + 16*x^6/6 + 29*x^7/7 + 45*x^8/8 + 94*x^9/9 + 186*x^10/10 + ... + A217464(n)*x^n/n + ...
-
CoefficientList[Series[((1 - x) - Sqrt[(1 - x)^2 - 4*x^3*(1 - x)])/(2*x^3 *(1 - x)), {x,0,50}], x] (* G. C. Greubel, Jan 24 2017 *)
-
a(n):=sum(sum(binomial(n-2*q-2,n-r-q)*binomial(q+1,r-1)*binomial(q+1,r) ,r,0,q+1)/(q+1), q,0,n); /* Vladimir Kruchinin, Jan 22 2019 */
a(n):=sum((binomial(2*m,m)*binomial(n-2*m+1,n-3*m))/(n-2*m+1),m,0,n/3);
/*Vladimir Kruchinin, Jan 27 2022 */
-
{a(n)=polcoeff(exp(sum(m=1,n+1,x^m/m*sum(k=0,m,binomial(m,k)^2*x^k*(1-x)^(m-k) + x*O(x^n)))),n)}
-
{a(n)=polcoeff(2/(1-x+sqrt((1-x)^2-4*x^3*(1-x) +x*O(x^n))),n)}
for(n=0,40,print1(a(n),", "))
-
a(n) = sum(k=0, n\3, binomial(n-2*k, k)*binomial(2*k, k)/(k+1)); \\ Seiichi Manyama, Jan 22 2023
A119370
G.f. satisfies A(x) = 1 + x*A(x)^2 + x^2*(A(x)^2 - A(x)).
Original entry on oeis.org
1, 1, 2, 6, 19, 64, 225, 816, 3031, 11473, 44096, 171631, 675130, 2679728, 10719237, 43168826, 174885089, 712222799, 2914150406, 11973792218, 49385167369, 204386777160, 848530495383, 3532844222611, 14747626307436, 61712139464939
Offset: 0
A(x) = 1 + x + 2*x^2 + 6*x^3 + 19*x^4 + 64*x^5 + 225*x^6 + 816*x^7 +...
x*A(x)^2 = x + 2*x^2 + 5*x^3 + 16*x^4 + 54*x^5 + 190*x^6 + 690*x^7 +...
x^2*( A(x)^2 - A(x) ) = 1*x^3 + 3*x^4 + 10*x^5 + 35*x^6 + 126*x^7 +...
-
R:=PowerSeriesRing(Rationals(), 30);
Coefficients(R!( (1+x^2 -Sqrt(1-4*x-2*x^2+x^4))/(2*x*(1+x)) )); // G. C. Greubel, Mar 17 2021
-
m:= 30;
S:= series( (1+x^2 -sqrt(1-4*x-2*x^2+x^4))/(2*x*(1+x)), x, m+1);
seq(coeff(S, x, j), j = 0..m); # G. C. Greubel, Mar 17 2021
-
CoefficientList[Series[((1+x^2)-Sqrt[(1+x^2)^2-4*x*(1+x)])/(2*x*(1+x)), {x, 0, 20}], x] (* Vaclav Kotesovec, Sep 11 2013 *)
-
{a(n)=polcoeff(2/((1+x^2)+sqrt((1+x^2)^2-4*x*(1+x)+x*O(x^n))),n)}
-
def A119370_list(prec):
P. = PowerSeriesRing(QQ, prec)
return P( (1+x^2 -sqrt(1-4*x-2*x^2+x^4))/(2*x*(1+x)) ).list()
A119370_list(30) # G. C. Greubel, Mar 17 2021
A105632
Triangle, read by rows, where the g.f. A(x,y) satisfies the equation: A(x,y) = 1/(1-x*y) + x*A(x,y) + x^2*A(x,y)^2.
Original entry on oeis.org
1, 1, 1, 2, 1, 1, 4, 3, 1, 1, 9, 7, 4, 1, 1, 21, 19, 10, 5, 1, 1, 51, 51, 31, 13, 6, 1, 1, 127, 141, 91, 45, 16, 7, 1, 1, 323, 393, 276, 141, 61, 19, 8, 1, 1, 835, 1107, 834, 461, 201, 79, 22, 9, 1, 1, 2188, 3139, 2535, 1485, 701, 271, 99, 25, 10, 1, 1, 5798, 8953, 7711, 4803, 2381, 1001, 351, 121, 28, 11, 1, 1
Offset: 0
Triangle begins:
1;
1, 1;
2, 1, 1;
4, 3, 1, 1;
9, 7, 4, 1, 1;
21, 19, 10, 5, 1, 1;
51, 51, 31, 13, 6, 1, 1;
127, 141, 91, 45, 16, 7, 1, 1;
323, 393, 276, 141, 61, 19, 8, 1, 1;
835, 1107, 834, 461, 201, 79, 22, 9, 1, 1; ...
Let G = (1-2*x-3*x^2), then the column g.f.s are:
k=1: 1/sqrt(G)
k=2: (G + (1)*1*x^2)/sqrt(G^3)
k=3: (G^2 + (1)*2*x^2*G + (2)*1*x^4)/sqrt(G^5)
k=4: (G^3 + (1)*3*x^2*G^2 + (2)*3*x^4*G + (5)*1*x^6)/sqrt(G^7)
k=5: (G^4 + (1)*4*x^2*G^3 + (2)*6*x^4*G^2 + (5)*4*x^6*G + (14)*1*x^8)/sqrt(G^9)
and involve Catalan numbers and binomial coefficients.
MATRIX INVERSE.
The matrix inverse starts
1;
-1, 1;
-1, -1, 1;
0, -2, -1, 1;
2, -1, -3, -1, 1;
6, 2, -2, -4, -1, 1;
13, 10, 2, -3, -5, -1, 1;
18, 32, 14, 2, -4, -6, -1, 1;
-12, 76, 56, 18, 2, -5, -7, -1, 1;
-206, 108, 162, 86, 22, 2, -6, -8, -1, 1;
- _R. J. Mathar_, Apr 08 2013
-
A105632 := proc(n,k)
(1-x-sqrt((1-x)^2-4*x^2/(1-x*y)))/2/x^2 ;
coeftayl(%,x=0,n) ;
coeftayl(%,y=0,k) ;
end proc: # R. J. Mathar, Apr 08 2013
-
T[n_, k_] := SeriesCoefficient[(1 - x - Sqrt[(1 - x)^2 - 4*x^2/(1 - x*y)])/(2*x^2), {x, 0, n}] // SeriesCoefficient[#, {y, 0, k}]&;
Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 10 2023 *)
-
{T(n,k)=local(A=1+x+x*y+x*O(x^n)+y*O(y^k)); for(i=1,n,A=1/(1-x*y)+x*A+x^2*A^2);polcoeff(polcoeff(A,n,x),k,y)}
-
{T(n,k)=local(X=x+x*O(x^n),Y=y+y*O(y^k));polcoeff(polcoeff( 2/(1-X+sqrt((1-X)^2-4*X^2/(1-X*Y)))/(1-X*Y),n,x),k,y)}
A258973
The number of plain lambda terms presented by de Bruijn indices, see Bendkowski et al., where zeros have no weight.
Original entry on oeis.org
1, 3, 10, 40, 181, 884, 4539, 24142, 131821, 734577, 4160626, 23881695, 138610418, 812104884, 4796598619, 28529555072, 170733683579, 1027293807083, 6211002743144, 37713907549066, 229894166951757, 1406310771154682, 8630254073158599, 53117142215866687, 327800429456036588
Offset: 0
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
- Maciej Bendkowski, Katarzyna Grygiel, Pierre Lescanne, and Marek Zaionc, Combinatorics of λ-terms: a natural approach, arXiv:1609.08106 [cs.LO], 2016.
- Maciej Bendkowski, Katarzyna Grygiel, Pierre Lescanne, and Marek Zaionc, A Natural Counting of Lambda Terms, arXiv preprint arXiv:1506.02367 [cs.LO], 2015.
- Maciej Bendkowski and Pierre Lescanne, On the enumeration of closures and environments with an application to random generation, Logical Methods in Computer Science (2019) Vol. 15, No. 4, 3:1-3:21.
- K. Grygiel and P. Lescanne, A natural counting of lambda terms, Preprint 2015.
-
a:= proc(n) option remember; `if`(n<4, [1, 3, 10, 40][n+1],
((8*n-3)*a(n-1)-(10*n-13)*a(n-2)
+(4*n-11)*a(n-3)-(n-4)*a(n-4))/(n+1))
end:
seq(a(n), n=0..25); # Alois P. Heinz, Jun 30 2015
a := n -> add(hypergeom([(i+1)/2, i/2+1, i-n+1], [1, 2], -4), i=0..n-1):
seq(simplify(a(n)), n=0..25); # Peter Luschny, May 03 2018
-
a[n_] := a[n] = If[n<4, {1, 3, 10, 40}[[n+1]], ((8*n-3)*a[n-1] - (10*n-13)*a[n-2] + (4*n-11)*a[n-3] - (n-4)*a[n-4])/(n+1)]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jul 22 2015, after Alois P. Heinz *)
-
a(n):=sum(sum((binomial(k+i-1,k-1)*binomial(2*k+i-2,k+i-1)*binomial(n-i-1,n-k-i))/k,k,1,n-i),i,0,n); /* Vladimir Kruchinin, May 03 2018 */
-
lista(nn) = {z = y + O(y^nn); Vec(((1-z)^2 - sqrt((1-z)^4-4*z*(1-z))) / (2*z*(1-z)));} \\ Michel Marcus, Jun 30 2015
A116424
Triangle read by rows: T(n,k) = the number of Dyck paths of semilength n with k UDUU's, 0 <= k <= floor((n-1)/2).
Original entry on oeis.org
1, 1, 2, 4, 1, 9, 5, 22, 19, 1, 57, 66, 9, 154, 221, 53, 1, 429, 729, 258, 14, 1223, 2391, 1131, 116, 1, 3550, 7829, 4652, 745, 20, 10455, 25638, 18357, 4115, 220, 1, 31160, 84033, 70404, 20598, 1790, 27, 93802, 275765, 264563, 96286, 12104, 379, 1, 284789
Offset: 0
I. Tasoulas (jtas(AT)unipi.gr), Feb 15 2006
Triangle begins:
00 : 1;
01 : 1;
02 : 2;
03 : 4, 1;
04 : 9, 5;
05 : 22, 19, 1;
06 : 57, 66, 9;
07 : 154, 221, 53, 1;
08 : 429, 729, 258, 14;
09 : 1223, 2391, 1131, 116, 1;
10 : 3550, 7829, 4652, 745, 20;
...
T(4,1) = 5 because there exist five Dyck paths of semilength 4 with one occurrence of UDUU : UDUUUDDD, UDUUDUDD, UDUUDDUD, UUDUUDDD, UDUDUUDD.
- Alois P. Heinz, Rows n = 0..200, flattened
- Jean-Luc Baril, Pamela E. Harris, Kimberly J. Harry, Matt McClinton, and José L. Ramírez, Enumerating runs, valleys, and peaks in Catalan words, arXiv:2404.05672 [math.CO], 2024. See p. 18.
- Toufik Mansour, Statistics on Dyck Paths, Journal of Integer Sequences, Vol. 9 (2006), Article 06.1.5.
- A. Sapounakis, I. Tasoulas and P. Tsikouras, Counting strings in Dyck paths, Discrete Math., 307 (2007), 2909-2924.
-
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, 4, 2][t])*
`if`(t=4, z, 1) +b(x-1, y-1, [1, 3, 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 02 2014
-
s = Series[((1 + (t - 1) z^2) - Sqrt[(1 + (t - 1) z^2)^2 - 4*z*(1 - z + z*t)])/(2*z*(1 - z + z*t)), {z, 0, 15}] // CoefficientList[#, z]&;
CoefficientList[#, t]& /@ s // Flatten (* updated by Jean-François Alcover, Feb 14 2021 *)
A273897
Triangle read by rows: T(n,k) is the number of bargraphs of semiperimeter n having abscissa of first descent k (n>=2, 1<=k<=n-1).
Original entry on oeis.org
1, 1, 1, 2, 2, 1, 4, 5, 3, 1, 9, 12, 9, 4, 1, 22, 30, 25, 14, 5, 1, 57, 78, 69, 44, 20, 6, 1, 154, 210, 192, 133, 70, 27, 7, 1, 429, 582, 542, 396, 230, 104, 35, 8, 1, 1223, 1651, 1554, 1176, 731, 369, 147, 44, 9, 1, 3550, 4772, 4521, 3504, 2285, 1248, 560, 200, 54, 10, 1
Offset: 2
Row 4 is 2,2,1 because the 5 (=A082582(4)) bargraphs of semiperimeter 4 correspond to the compositions [1,1,1], [1,2], [2,1], [2,2], [3] and the corresponding pictures give the values 3,2,1,2,1 for the abscissae of the first descents.
Triangle starts
1;
1,1;
2,2,1;
4,5,3,1;
9,12,9,4,1;
22,30,25,14,5,1.
-
G := (1/2)*t*z*(1-2*t*z-z^2-sqrt(1-4*z+2*z^2+z^4))/(1-t-z+t^2*z+t*z^2): Gser := simplify(series(G, z = 0, 20)): for n from 2 to 18 do P[n] := sort(expand(coeff(Gser, z, n))) end do: for n from 2 to 18 do seq(coeff(P[n], t, j), j = 1 .. n-1) end do; # yields sequence in triangular form
-
nmax = 13; G = (1/2) t z (1 - 2t z - z^2 - Sqrt[1 - 4z + 2z^2 + z^4])/(1 - t - z + t^2 z + t z^2); Gser = G + O[z]^nmax;
Do[P[n] = Expand[Coefficient[Gser, z, n]], {n, 2, nmax}];
Table[CoefficientList[P[n]/t, t], {n, 2, nmax}] // Flatten (* Jean-François Alcover, Jul 24 2018, from Maple *)
A332776
a(n) = 1 + Sum_{k=1..n-1} binomial(n-1,k) * a(k) * a(n-k-1).
Original entry on oeis.org
1, 1, 2, 5, 18, 83, 464, 3041, 22810, 192595, 1807328, 18658097, 210138882, 2563990859, 33691089824, 474327797585, 7123141539610, 113656386574099, 1920170741071280, 34242622099969217, 642792206343361602, 12669617513914228907, 261613287097165614224, 5647565141926833774977
Offset: 0
-
a[n_] := a[n] = 1 + Sum[Binomial[n - 1, k] a[k] a[n - k - 1], {k, 1, n - 1}]; Table[a[n], {n, 0, 23}]
terms = 23; A[] = 0; Do[A[x] = Normal[Integrate[Exp[x] + A[x] (A[x] - 1), x] + O[x]^(terms + 1)], terms]; CoefficientList[A[x], x] Range[0, terms]!
A346075
a(n) = 1 + Sum_{k=1..n-3} a(k) * a(n-k-3).
Original entry on oeis.org
1, 1, 1, 1, 2, 3, 4, 6, 10, 16, 25, 41, 69, 115, 192, 326, 558, 955, 1641, 2839, 4930, 8578, 14972, 26222, 46037, 80988, 142793, 252307, 446617, 791885, 1406394, 2501642, 4456080, 7947963, 14194221, 25379751, 45430710, 81409233, 146028788, 262192876, 471193406
Offset: 0
-
a[n_] := a[n] = 1 + Sum[a[k] a[n - k - 3], {k, 1, n - 3}]; Table[a[n], {n, 0, 40}]
nmax = 40; A[] = 0; Do[A[x] = 1/(1 - x) + x^3 A[x] (A[x] - 1) + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
-
@CachedFunction
def a(n): # a = A346075
if (n<4): return 1
else: return 1 + sum(a(k)*a(n-k-3) for k in range(1,n-2))
[a(n) for n in range(51)] # G. C. Greubel, Nov 27 2022
A346076
a(n) = 1 + Sum_{k=1..n-4} a(k) * a(n-k-4).
Original entry on oeis.org
1, 1, 1, 1, 1, 2, 3, 4, 5, 7, 11, 17, 25, 36, 54, 84, 131, 201, 307, 475, 745, 1172, 1837, 2878, 4531, 7173, 11381, 18057, 28669, 45624, 72796, 116336, 186066, 297865, 477505, 766621, 1232214, 1982292, 3191693, 5143974, 8298640, 13399691, 21652705, 35014373, 56663700
Offset: 0
-
a[n_] := a[n] = 1 + Sum[a[k] a[n - k - 4], {k, 1, n - 4}]; Table[a[n], {n, 0, 44}]
nmax = 44; A[] = 0; Do[A[x] = 1/(1 - x) + x^4 A[x] (A[x] - 1) + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
-
@CachedFunction
def a(n): # a = A346076
if (n<5): return 1
else: return 1 + sum(a(k)*a(n-k-4) for k in range(1,n-3))
[a(n) for n in range(51)] # G. C. Greubel, Nov 27 2022
Showing 1-10 of 19 results.
Comments