A004148 Generalized Catalan numbers: a(n+1) = a(n) + Sum_{k=1..n-1} a(k)*a(n-1-k).
1, 1, 1, 2, 4, 8, 17, 37, 82, 185, 423, 978, 2283, 5373, 12735, 30372, 72832, 175502, 424748, 1032004, 2516347, 6155441, 15101701, 37150472, 91618049, 226460893, 560954047, 1392251012, 3461824644, 8622571758, 21511212261, 53745962199, 134474581374
Offset: 0
Examples
G.f. = 1 + x + x^2 + 2*x^3 + 4*x^4 + 8*x^5 + 17*x^6 + 37*x^7 + 82*x^8 + 185*x^9 + 432*x^10 + ... Det([1]) = 1, Det([1, 1; 1, 1]) = 0, Det([1, 1, 1; 1, 1, 2; 1, 2, 4]) = -1. - _Michael Somos_, May 12 2022
References
- A. Nkwanta, Lattice paths and RNA secondary structures, DIMACS Series in Discrete Math. and Theoretical Computer Science, 34, 1997, 137-147.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- Seiichi Manyama, Table of n, a(n) for n = 0..2404 (first 201 terms from T. D. Noe)
- Andrei Asinowski, Axel Bacher, Cyril Banderier and Bernhard Gittenberger, Analytic Combinatorics of Lattice Paths with Forbidden Patterns: Enumerative Aspects, in International Conference on Language and Automata Theory and Applications, S. Klein, C. Martín-Vide, D. Shapira (eds), Springer, Cham, pp 195-206, 2018.
- Andrei Asinowski, Axel Bacher, Cyril Banderier and Bernhard Gittenberger, Analytic combinatorics of lattice paths with forbidden patterns, the vectorial kernel method, and generating functions for pushdown automata, Laboratoire d'Informatique de Paris Nord (LIPN 2019).
- Andrei Asinowski, Cyril Banderier and Valerie Roitner, Generating functions for lattice paths with several forbidden patterns, (2019).
- Sergey Avgustinovich, Sergey Kitaev and Alexander Valyuzhenich, Avoidance of boxed mesh patterns on permutations.
- Jean Luc Baril, Rigoberto Flórez, and José L. Ramirez, Generalized Narayana arrays, restricted Dyck paths, and related bijections, Univ. Bourgogne (France, 2025). See pp. 22, 27.
- Jean-Luc Baril, Sergey Kirgizov, Rémi Maréchal, and Vincent Vajnovszki, Grand Dyck paths with air pockets, arXiv:2211.04914 [math.CO], 2022.
- Jean-Luc Baril, Sergey Kirgizov and Armen Petrossian, Enumeration of Łukasiewicz paths modulo some patterns, arXiv:1804.01293 [math.CO], 2018.
- Jean-Luc Baril and José L. Ramírez, Knight's paths towards Catalan numbers, Univ. Bourgogne Franche-Comté (2022).
- Jean-Luc Baril and José Luis Ramírez, Descent distribution on Catalan words avoiding ordered pairs of Relations, arXiv:2302.12741 [math.CO], 2023.
- Jean-Luc Baril and José L. Ramírez, Fibonacci and Catalan paths in a wall, 2023.
- Paul Barry, On a Generalization of the Narayana Triangle, J. Int. Seq. 14 (2011) # 11.4.5.
- Paul Barry, Jacobsthal Decompositions of Pascal's Triangle, Ternary Trees, and Alternating Sign Matrices, Journal of Integer Sequences, 19, 2016, #16.3.5.
- Paul Barry, Riordan Pseudo-Involutions, Continued Fractions and Somos 4 Sequences, arXiv:1807.05794 [math.CO], 2018.
- Paul Barry, Generalized Catalan recurrences, Riordan arrays, elliptic curves, and orthogonal polynomials, arXiv:1910.00875 [math.CO], 2019.
- Paul Barry, Conjectures on Somos 4, 6 and 8 sequences using Riordan arrays and the Catalan numbers, arXiv:2211.12637 [math.CO], 2022.
- Paul Barry, Aoife Hennessy and Nikolaos Pantelidis, Algebraic properties of Riordan subgroups, J Algebr Comb 53, 1015-1036 (2021).
- Antonio Bernini, Matteo Cervetti, Luca Ferrari and Einar Steingrimsson, Enumerative combinatorics of intervals in the Dyck pattern poset, arXiv:1910.00299 [math.CO], 2019.
- M. Bona and A. Knopfmacher, On the probability that certain compositions have the same number of parts, Ann. Comb., 14 (2010), 291-306.
- A. J. Bu and Robert Dougherty-Bliss, Enumerating Restricted Dyck Paths with Context-Free Grammars, arXiv:2009.09061 [math.CO], 2020.
- Alexander Burstein and Louis W. Shapiro, Pseudo-involutions in the Riordan group, arXiv:2112.11595 [math.CO], 2021.
- Naiomi T. Cameron and Asamoah Nkwanta, On Some (Pseudo) Involutions in the Riordan Group, Journal of Integer Sequences, Vol. 8 (2005), Article 05.3.7.
- Naiomi Cameron and Everett Sullivan, Peakless Motzkin paths with marked level steps at fixed height, Discrete Mathematics 344.1 (2021): 112154.
- C. Coker, Enumerating a class of lattice paths, Discrete Math., 271 (2003), 13-28.
- Emeric Deutsch and Sergi Elizalde, Restricted simsun permutations, Ann. Comb. 16, No. 2, 253-269 (2012).
- Emeric Deutsch and L. W. Shapiro, A bijection between ordered trees and 2-Motzkin paths and its many consequences, Disc. Math. 256 (2002) 655-670.
- R. Donaghey, Automorphisms on Catalan trees and bracketing, J. Combin. Theory, Series B, 29 (1980), 75-90.
- Robert G. Donnelly, Molly W. Dunkum, Sasha V. Malone, and Alexandra Nance, Symmetric Fibonaccian distributive lattices and representations of the special linear Lie algebras, arXiv:2012.14991 [math.CO], 2020.
- T. Doslic, D. Svrtan and D. Veljan, Enumerative aspects of secondary structures, Discr. Math., 285 (2004), 67-82.
- Robert Dougherty-Bliss, Experimental Methods in Number Theory and Combinatorics, Ph. D. Dissertation, Rutgers Univ. (2024). See p. 96.
- D. Drake, Bijections from Weighted Dyck Paths to Schröder Paths, J. Int. Seq. 13 (2010) # 10.9.2.
- Eric S. Egge and Kailee Rubin, Snow Leopard Permutations and Their Even and Odd Threads, arXiv:1508.05310 [math.CO], 2015.
- S. B. Ekhad and M. Yang, Automated proofs of many conjectured recurrences in the OEIS made by R. J. Mathar, arXiv:1707.04654 (2017).
- S. J. Evans, A. P. Veselov, and B. Winn, Quantum Kronecker fractions, arXiv:2410.15666 [math.NT], 2024. See p. 7.
- Juan B. Gil and Luiz E. Lopez, Enumeration of symmetric arc diagrams, arXiv:2203.10589 [math.CO], 2022.
- Guo-Niu Han and Emmanuel Pedon, Hankel continued fractions and Hankel determinants for q-deformed metallic numbers, arXiv:2502.05993 [math.NT], 2025. See p. 5.
- Ivo L. Hofacker, Christian M. Reidys, and Peter F. Stadler, Symmetric circular matchings and RNA folding. Discr. Math., 312:100-112, 2012. See Eq. 27.
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 421
- Emma Y. Jin and Christian M. Reidys, Asymptotic Enumeration of RNA Structures with Pseudoknots, Bulletin of Mathematical Biology 70 (2008), 951-970. See Eq. 22.
- Shu-Chung Liu, Jun Ma and Yeong-Nan Yeh, Dyck Paths with Peak- and Valley-Avoiding Sets, Stud. Appl Math. 121 (3) (2008) 263-289. [From Majun (majun(AT)math.sinica.edu.tw), Nov 29 2008]
- Sophie Morier-Genoud and Valentin Ovsienko, On q-deformed real numbers, arXiv:1908.04365 [math.QA], 2019.
- Sophie Morier-Genoud and Valentin Ovsienko, Quantum real numbers and q-deformed Conway-Coxeter friezes, arXiv:2011.10809 [math.QA], 2020. See section 3.3. Mentions this sequence.
- Sophie Morier-Genoud and Valentin Ovsienko, q-deformed rationals and irrationals, arXiv:2503.23834 [math.CO], 2025. See p. 13.
- Emanuele Munarini and Norma Zagaglia Salvi, Binary strings without zigzags, Séminaire Lotharingien de Combinatoire, B49h (2004), 15 pp.
- A. Nkwanta and A. Tefera, Curious Relations and Identities Involving the Catalan Generating Function and Numbers, Journal of Integer Sequences, 16 (2013), #13.9.5.
- Valentin Ovsienko, Modular invariant q-deformed numbers: first steps, 2023.
- A. Panayotopoulos and P. Vlamos, Cutting Degree of Meanders, Artificial Intelligence Applications and Innovations, IFIP Advances in Information and Communication Technology, Volume 382, 2012, pp 480-489; DOI 10.1007/978-3-642-33412-2_49. - From _N. J. A. Sloane_, Dec 29 2012
- Helmut Prodinger, Cornerless, peakless, valleyless Motzkin paths (regular and skew) and applications to bargraphs, arXiv:2501.13645 [math.CO], 2025. See p. 8.
- N. J. A. Sloane, Illustration of a(6) = 17 (after Waterman, 1978).
- P. R. Stein and M. S. Waterman, On some new sequences generalizing the Catalan and Motzkin numbers, Discrete Math., 26 (1978), 261-272.
- P. R. Stein and M. S. Waterman, On some new sequences generalizing the Catalan and Motzkin numbers [Corrected annotated scanned copy]
- M. Vauchassade de Chaumont and G. Viennot, Polynômes orthogonaux et problèmes d'énumération en biologie moléculaire, Sem. Loth. Comb. B08l (1984) 79-86.
- M. S. Waterman, Home Page (contains copies of his papers)
- M. S. Waterman, Secondary structure of single-stranded nucleic acids, Studies in Foundations and Combinatorics, Vol. 1, pp. 167-212, 1978.
Crossrefs
Programs
-
Haskell
a004148 n = a004148_list !! n a004148_list = 1 : f [1] where f xs'@(x:xs) = y : f (y : xs') where y = x + sum (zipWith (*) xs $ reverse $ tail xs) -- Reinhard Zumkeller, Nov 13 2012
-
Magma
R
:=PowerSeriesRing(Rationals(), 35); Coefficients(R!( (1-x+x^2 - Sqrt(1-2*x-x^2-2*x^3+x^4))/(2*x^2) )); // G. C. Greubel, Dec 30 2019 -
Maple
w := proc(l) x - 1 - x^2*(1 - x^l)/(1-x) end: S := proc(l) (-w(l) - sqrt(w(l)^2 - 4*x^2))/(2*x^2) end: # S(0) is g.f. for Motzkin numbers A001006, # S(1) is g.f. for this sequence, # S(2) is g.f. for A004149, etc.
-
Mathematica
a[0]=1; a[n_Integer]:= a[n]= a[n-1]+Sum[a[k]*a[n-2-k], {k,n-2}]; Array[a, 35, 0] CoefficientList[Series[(1-x+x^2-Sqrt[x^4-2x^3-x^2-2x+1])/(2x^2), {x,0,40}], x] (* Harvey P. Dale, May 09 2011 *) a[n_]:= SeriesCoefficient[(1 -x +x^2 -Sqrt[1 -2x -x^2 -2x^3 +x^4])/(2x^2), {x, 0, n}]; (* Michael Somos, Jun 05 2014 *) a[n_] := HypergeometricPFQ[{-n/2, (1-n)/2, (1-n)/2, 1-n/2}, {2, -n, -n + 1}, 16]; Array[a, 33, 0] (* Peter Luschny, Jan 25 2020 *) Table[If[n==0,1, Sum[(Binomial[n-k,k+1]Binomial[n-k,k]/(n-k)), {k,0,n-1}]], {n,0,10}] (* Rigoberto Florez, Apr 17 2023 *) CoefficientList[Nest[1+x(1-x) #+x^2 #^2 &, 1+O[x], 32], x](* Oliver Seipel, Dec 21 2024 *)
-
Maxima
a(n):=coeff(taylor((1-x+x^2-sqrt(1-2*x-x^2-2*x^3+x^4))/(2*x^2),x,0,n),x, n); makelist(a(n),n,0,12); /* Emanuele Munarini, Jul 07 2001 */
-
PARI
{a(n) = polcoeff( (1 - x + x^2 - sqrt(1 - 2*x - x^2 + x^3 * (-2 + x + O(x^n)))) / 2, n + 2)}; /* Michael Somos, Jul 20 2003 */
-
PARI
a(n,m=1)=sum(k=0,n,sum(j=0,k,binomial(n-k+j+m,n-k)*m/(n-k+j+m)*binomial(n-k,k-j)*binomial(k-j,j))) \\ Paul D. Hanna, Jun 26 2009
-
PARI
{a(n)=polcoeff(1+x*exp(sum(m=1,n,sum(k=0,m,binomial(m,k)^2*x^k)*x^m/m)+x*O(x^n)),n)} /* Paul D. Hanna, Mar 15 2011 */
-
PARI
{a(n)=local(A051292=1+(1-x^2)/sqrt((1-3*x+x^2)*(1+x+x^2) +x*O(x^n)));polcoeff(exp(sum(m=1,n,polcoeff(A051292,m)*x^m/m)+x*O(x^n)),n)} /* Paul D. Hanna, Mar 15 2011 */
-
PARI
{a(n) = my(A = 1 + O(x)); for(k=1, n, A = 1 - x / (x^2 - 1/A)); polcoeff( A, n)}; /* Michael Somos, Jun 05 2014 */
-
Sage
def A004148_list(prec): P = PowerSeriesRing(ZZ, 'x', prec) x = P.gen().O(prec) return ( (1-x+x^2 -sqrt(1-2*x-x^2-2*x^3+x^4))/(2*x^2) ).list() A004148_list(35) # G. C. Greubel, Dec 30 2019
Formula
a(n+1) = a(n) + a(1)*a(n-2) + a(2)*a(n-3) + ... + a(n-1)*a(0).
G.f.: (1 - x + x^2 - sqrt(1 - 2*x - x^2 - 2*x^3 + x^4)) / (2*x^2). - Michael Somos, Jul 20 2003
G.f.: (1/z)*(1-C(-z/(1-3*z+z^2))), where C(z)=(1-sqrt(1-4*z))/(2*z) is the Catalan function. - Emeric Deutsch, Nov 19 2003
G.f.: 1 + F(x, x)/x, where F(x, t) is the g.f. of the Narayana numbers: xF^2 - (1-x-tx)F + tx = 0. - Emeric Deutsch, Nov 19 2003
G.f. A(x) satisfies the functional equation: x^2*A(x)^2 - (x^2 - x + 1)*A(x) + 1 = 0. - Michael Somos, Jul 20 2003
Series reversion of g.f. A(x) is -A(-x) (if offset 1). - Michael Somos, Jul 20 2003
a(n) = Sum_{k=ceiling((n+1)/2)..n} (binomial(k, n-k)*binomial(k, n-k+1)/k) for n >= 1. - Emeric Deutsch, Nov 12 2003 This formula counts (i) disjoint-diagonal dissections by number of diagonals, (ii) peak-less Motzkin paths by number of up steps, (iii) UUU- and DDD-free Dyck paths by number of ascents. - David Callan, Mar 23 2004
a(n) = Sum_{k=0..floor(n/2)} A131198(n-k,k). - Philippe Deléham, Nov 06 2007
G.f.: 1/(1-x/(1-x^2/(1-x/(1-x^2/(1-x/(1-x^2/(1-x... (continued fraction). - Paul Barry, Dec 08 2008
G.f.: 1/(1-x/(1-x(x-1)-x/(1-x(x-1)-x/(1-x(x-1)-x/(1-... (continued fraction). - Paul Barry, May 16 2009
From Paul D. Hanna, Jun 26 2009: (Start)
Let A(x)^m = Sum_{n>=0} a(n,m)*x^n, then
a(n,m) = Sum_{k=0..n} Sum_{j=0..k} C(n-k+j+m,n-k)*m/(n-k+j+m) * C(n-k,k-j)*C(k-j,j).
(End)
From Paul Barry, Mar 10 2010: (Start)
G.f.: (1/(1+x^2))*M(x/(1+x^2)), M(x) the g.f. of the Motzkin numbers A001006;
G.f.: 1/(1-x+x^2-x^2/(1-x+x^2-x^2/(1-x+x^2-x^2/(1-x+x^2-x^2/(1-... (continued fraction).
a(n) = Sum_{k=0..floor(n/2)} (-1)^k*C(n-k,k)*A001006(n-2*k). (End)
G.f.: 1 + x*exp( Sum_{n>=1} (x^n/n)*(Sum_{k=0..n} C(n,k)^2*x^k) ). - Paul D. Hanna, Mar 15 2011
G.f.: exp( Sum_{n>=1} A051292(n)*x^n/n ), where A051292(n) is a Whitney number of level n. - Paul D. Hanna, Mar 15 2011
Let the g.f. be A(x), then B(x)=(1+x*A(x)) = 1/(1-z/(1-z/(1-z/(...)))) where z=x/(1+x+x^2), B(x) = 1 +1*x + 1*x^2 +1*x^3 + 2*x^4 + 4*x^5 + ... is the g.f. of this sequence prepended with 1; more generally B(x) = C(x/(1+x+x^2)) where C(x) is the g.f. for the Catalan numbers (A000108). - Joerg Arndt, Mar 18 2011
D-finite with recurrence: (n+2)*a(n) - (2n+1)*a(n-1) + (1-n)*a(n-2) + (5-2n)*a(n-3) + (n-4)*a(n-4) = 0. - R. J. Mathar, Dec 01 2011. This recurrence follows from the Wilf-Zeilberger (WZ) proof technique applied to Sum_{k=ceiling((n+1)/2)..n} (binomial(k,n-k) * binomial(k,n-k+1)/k). - T. Amdeberhan, Jul 23 2012
Given g.f. A(x), then B(x) = x * A(x) satisfies B(x) = x + x*B(x) / (1 - x*B(x)). - Michael Somos, Jun 05 2014
G.f.: 1 - x / (x^2 - 1 / (1 - x / (x^2 - 1 / (1 - x / (x^2 - ...))))). - Michael Somos, Jun 05 2014
0 = a(n)*(a(n+1) - 5*a(n+2) - 4*a(n+3) - 11*a(n+4) + 7*a(n+5)) + a(n+1)*(a(n+1) + 6*a(n+2) + 12*a(n+3) + 11*a(n+4) - 11*a(n+5)) + a(n+2)*(-a(n+2) - 7*a(n+3) + 12*a(n+4) - 4*a(n+5)) + a(n+3)*(-a(n+3) + 6*a(n+4) - 5*a(n+5)) + a(n+4)*(a(n+4) + a(n+5)) if n >= -1. - Michael Somos, Jun 05 2014
a(n) = hypergeom([-n/2, (1 - n)/2, (1 - n)/2, 1 - n/2], [2, -n, -n + 1], 16). - Peter Luschny, Jan 25 2020
a(n) = Sum_{k=0..n-1} binomial(n-k,k+1)*binomial(n-k,k)/(n-k) for n > 0. - Rigoberto Florez, Apr 17 2023
a(n) ~ 5^(1/4) * phi^(2*n + 2) / (2 * sqrt(Pi) * n^(3/2)), where phi = A001622 is the golden ratio. - Vaclav Kotesovec, May 05 2023
Comments