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

A004148 Generalized Catalan numbers: a(n+1) = a(n) + Sum_{k=1..n-1} a(k)*a(n-1-k).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Arises in enumerating secondary structures of RNA molecules. The 17 structures with 6 nucleotides are shown in the illustration (after Waterman, 1978).
Hankel transform is period 8 sequence [1, 0, -1, -1, -1, 0, 1, 1, ...] (A046980).
Enumerates peak-less Motzkin paths of length n. Example: a(5)=8 because we have HHHHH, HHUHD, HUHDH, HUHHD, UHDHH, UHHDH, UHHHD, UUHDD, where U=(1,1), D=(1,-1) and H=(1,0). - Emeric Deutsch, Nov 19 2003
Number of Dyck paths of semilength n-1 with no UUU's and no DDD's, where U=(1,1) and D=(1,-1) (n>0). - Emeric Deutsch, Nov 19 2003
For n >= 1, a(n) = number of dissections of an (n+2)-gon with strictly disjoint diagonals and no diagonal incident with the base. (One side of the (n+2)-gon is designated the base.) - David Callan, Mar 23 2004
For n >= 2, a(n-2)= number of UU-free Motzkin n-paths = number of DU-free Motzkin n-paths. - David Callan, Jul 15 2004
a(n) = number of UU-free Motzkin n-paths containing no low peaks (A low peak is a UD pair at ground level, i.e., whose removal would create a pair of Motzkin paths). For n >= 1, a(n) = number of UU-free Motzkin (n-1)-paths = number of DU-free Motzkin (n-1)-paths. a(n) is asymptotically ~ c n^(-3/2) (1 + phi)^n with c = 1.1043... and phi=(1+sqrt(5))/2. - David Callan, Jul 15 2004. In closed form, c = sqrt(30+14*sqrt(5))/(4*sqrt(Pi)) = 1.104365547309692849... - Vaclav Kotesovec, Sep 11 2013
a(n) = number of Dyck (n+1)-paths with all pyramid sizes >= 2. A pyramid is a maximal subpath of the form k upsteps immediately followed by k downsteps and its size is k. - David Callan, Oct 24 2004
a(n) = number of Dyck paths of semilength n+1 with no small pyramids (n >= 1). A pyramid is a maximal sequence of the form k Us followed by k Ds with k >= 1. A small pyramid is one with k=1. For example, a(4)=4 counts the following Dyck 5-paths (pyramids denoted by lowercase letters and separated by a vertical bar): uuuuuddddd, Uuudd|uuddD, uudd|uuuddd, uuuddd|uudd. - David Callan, Oct 25 2004
From Emeric Deutsch, Jan 08 2006: (Start)
a(n) = number of Motzkin paths of length n-1 with no peaks at level >= 1. Example: a(4)=4 because we have HHH, HUD, UDH and UHD, where U=(1,1), D=(1,-1) and H=(1,0).
a(n) = number of Motzkin paths of length n+1 with no level steps on the x-axis and no peaks at level >=1. Example: a(4)=4 because we have UHHHD, UHDUD, UDUHD and UUHDD, where U=(1,1), D=(1,-1) and H=(1,0).
a(n) = number of Dyck paths of length 2n having no ascents and descents of even length. An ascent (descent) is a maximal sequence of up (down) steps. Example: a(4)=4 because we have UDUDUDUD, UDUUUDDD, UUUDDDUD and UUUDUDDD, where U=(1,1), D=(1,-1) and H=(1,0).
a(n) = number of Dyck paths of length 2n having ascents only of length 1 or 2 and having no peaks of the form UUDD. An ascent is a maximal sequence of up steps. Example: a(4)=4 because we have UDUDUDUD, UDUUDUDD, UUDUDDUD and UUDUDUDD, where U=(1,1), D=(1,-1) and H=(1,0).
a(n) = number of noncrossing partitions of [n+1] having no singletons and in each block the two leftmost points are of the form i,i+1. Example: a(4)=4 because we have 12345, 12/345, 123/45 and 125/34; the noncrossing partition 145/23 does not satisfy the requirements because 1 and 4 are not consecutive.
a(n) = number of noncrossing partitions of [n+1] with no singletons, except possibly the block /1/ and no blocks of the form /i,i+1/, except possibly the block /1,2/. Example: a(4)=4 because we have 12345, 1/2345, 12/345 and 15/234.
(End)
a(n+1) = [1, 1, 2, 4, 8, 17, 37, ...] gives the antidiagonal sums of triangle of Narayana, A001263. - Philippe Deléham, Oct 21 2006
a(n) = number of Dyck (n+1)-paths with no UDUs and no DUDs. For example, a(4)=4 counts UUUUUDDDDD, UUUDDUUDDD, UUDDUUUDDD, UUUDDDUUDD. - David Callan, May 08 2007
a(n) is also the number of Dyck paths of semilength n without height of peaks and valleys 2(mod 3). - Majun (majun(AT)math.sinica.edu.tw), Nov 29 2008
G.f. of a(n+1) is 1/(1-x-x^2-x^3/(1-x-x^2-x^3/(1-... (continued fraction). - Paul Barry, May 20 2009
A Chebyshev transform of the Motzkin numbers A001006: g.f. is the image of (1-x-(1-2x-3x^2)^(1/2))/(2x^2) under the mapping that takes g(x) to (1/(1+x^2))g(x/(1+x^2)). - Paul Barry, Mar 10 2010
For n >= 1, the number of lattice paths of weight n -1 that start in (0,0), end on the horizontal axis and never go below this axis, whose steps are of the following four kinds: an (1,0)-step with weight 1, an (1,0)-step with weight 2, a (1,1)-step with weight 2, and a (1,-1)-step with weight 1. The weight of a path is the sum of the weights of its steps. a(4)=4 because, denoting by h (H) the (1,0)-step of weight 1 (2), and u=(1,1), d=(1,-1), we have the following four paths of weight 3: hH, Hh, hhh, and ud. (See the g.f. C(x) on p. 295 of the Bona-Knopfmacher reference.)
From David Callan, Aug 27 2014: (Start)
a(n) = number of noncrossing partitions of [n] with all blocks of size 1 or 2 and no blocks of the form /i,i+1/. Example: a(4)=4 because we have 1234, 13/2/4, 14/2/3, and 1/24/3.
It appears that a(n) = number of permutations of [n] that avoid the three dashed patterns 123, 132, 24-13, and contain no small jumps (jumps of one unit). For example, a(4)=4 counts 3214, 3241, 4213, and 4321 but not 4312 because 12 is a small jump. (End)
Number of DU_{k}-equivalence classes of Łukasiewicz paths. Łukasiewicz paths are P-equivalent iff the positions of pattern P are identical in these paths. - Sergey Kirgizov, Apr 08 2018
a(n) is also the number of 3412-avoiding involutions on [n] with no transpositions of the form (i,i+1). For example, a(4)=4 counts the involutions 1234, 1432, 3214, 4231. - Juan B. Gil, May 23 2020
For n >= 2, a(n) equals the number of Dyck paths with air pockets of length n. A Dyck path with air pockets is a nonempty lattice path in the first quadrant of Z^2 starting at the origin, ending on the x-axis, and consisting of up-steps U = (1,1) and down-steps D_k = (1, -k), k >= 1, where two down-steps cannot be consecutive. For example, the only path of length 2 is UD_1; for length 3 we have UU_D2; for length 4 there are 2 paths: UUUD_3, UD_1UD_1; and for length 5 we have 4 paths: UUUUD_4, UUD_2UD_1, UD_1UUD_2, UUD_1UD_2. - Sergey Kirgizov, Dec 15 2022

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).

Crossrefs

Second row of A064645.
Cf. A046980 (Hankel transform).

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) = A088518(2n) + A088518(2n+1) - A088518(2n+2). - Emeric Deutsch, Nov 19 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

A051286 Whitney number of level n of the lattice of the ideals of the fence of order 2n.

Original entry on oeis.org

1, 1, 2, 5, 11, 26, 63, 153, 376, 931, 2317, 5794, 14545, 36631, 92512, 234205, 594169, 1510192, 3844787, 9802895, 25027296, 63972861, 163701327, 419316330, 1075049011, 2758543201, 7083830648, 18204064403, 46812088751, 120452857976
Offset: 0

Views

Author

Keywords

Comments

A Chebyshev transform of the central trinomial numbers A002426: image of 1/sqrt(1-2x-3x^2) under the mapping that takes g(x) to (1/(1+x^2))*g(x/(1+x^2)). - Paul Barry, Jan 31 2005
a(n) has same parity as Fibonacci(n+1) = A000045(n+1); see A107597. - Paul D. Hanna, May 22 2005
This is the second kind of Whitney numbers, which count elements, not to be confused with the first kind, which sum Mobius functions. - Thomas Zaslavsky, May 07 2008
From Paul Barry, Mar 31 2010: (Start)
Apply the Riordan array (1/(1-x+x^2),x/(1-x+x^2)) to the aerated central binomial coefficients with g.f. 1/sqrt(1-4x^2).
Hankel transform is A174882. (End)
a(n) is the number of lattice paths in L[n]. The members of L[n] are lattice paths of weight n that start at (0,0), end on the horizontal axis and whose steps are of the following four kinds: an (1,0)-step h with weight 1, an (1,0)-step H with weight 2, a (1,1)-step U with weight 2, and a (1,-1)-step D with weight 1. The weight of a path is the sum of the weights of its steps. Example: a(3)=5 because we have hhh, hH, Hh, UD, and DU; a(4)=11 because we have hhhh, hhH, hHh, Hhh, HH, hUD, UhD, UDh, hDU, DhU, and DUh (see the Bona-Knopfmacher reference).
Apparently the number of peakless grand Motzkin paths of length n. - David Scambler, Jul 04 2013
A bijection between L[n] (as defined above) and peakless grand Motzkin paths of length n is now given in arXiv:2002.12874. - Sergi Elizalde, Jul 14 2021
a(n) is also the number of unimodal bargraphs with a centered maximum (i.e., whose column heights are weakly increasing in the left half and weakly decreasing in the right half) and semiperimeter n+1. - Sergi Elizalde, Jul 14 2021
Diagonal of the rational function 1 / ((1 - x)*(1 - y) - (x*y)^2). - Ilya Gutkovskiy, Apr 23 2025
a(n) is the number of rooted ordered trees with node weights summing to n, where the root has weight 0, non-root node weights are in {1,2}, and no nodes have the same weight as their parent node. - John Tyler Rascoe, Jun 10 2025

Examples

			a(3) = 5 because the ideals of size 3 of the fence F(6) = { x1 < x2 > x3 < x4 > x5 < x6 } are x1*x3*x5, x1*x2*x3, x3*x4*x5, x1*x5*x6, x3*x5*x6.
		

Crossrefs

Cf. main diagonal of A125250, column k=2 of A384747.
Cf. A051291, A051292, A078698, A107597, A185828 (log), A174882 (Hankel transf.).

Programs

  • Maple
    seq( sum('binomial(i-k,k)*binomial(i-k,k)', 'k'=0..floor(i/2)), i=0..30 ); # Detlef Pauly (dettodet(AT)yahoo.de), Nov 09 2001
    # second Maple program:
    a:= proc(n) option remember; `if`(n<4, [1$2, 2, 5][n+1],
         ((2*n-1)*a(n-1)+(n-1)*a(n-2)+(2*n-3)*a(n-3)-(n-2)*a(n-4))/n)
        end:
    seq(a(n), n=0..35);  # Alois P. Heinz, Aug 11 2016
  • Mathematica
    Table[Sum[Binomial[n-k,k]^2,{k,0,Floor[n/2]}],{n,0,40}] (* Emanuele Munarini, Mar 01 2011; corrected by Harvey P. Dale, Sep 12 2012 *)
    CoefficientList[Series[1/Sqrt[1-2*x-x^2-2*x^3+x^4], {x, 0, 20}], x] (* Vaclav Kotesovec, Jan 05 2013 *)
    a[n_] := HypergeometricPFQ[ {(1-n)/2, (1-n)/2, -n/2, -n/2}, {1, -n, -n}, 16]; Table[a[n], {n, 0, 29}] (* Jean-François Alcover, Feb 26 2013 *)
  • Maxima
    makelist(sum(binomial(n-k,k)^2,k,0,floor(n/2)),n,0,40);  /* Emanuele Munarini, Mar 01 2011 */
    
  • PARI
    a(n)=polcoeff(1/sqrt((1+x+x^2)*(1-3*x+x^2)+x*O(x^n)),n)
    
  • PARI
    a(n)=sum(k=0,n,binomial(n-k,k)^2) /* Paul D. Hanna */
    
  • PARI
    {a(n)=polcoeff( exp(sum(m=1,n, sum(k=0,m, binomial(2*m,2*k)*x^k) *x^m/m) +x*O(x^n)), n)}  /* Paul D. Hanna, Mar 18 2011 */
    
  • PARI
    {a(n)=local(A=1); A=sum(m=0, n, x^m*sum(k=0, m, binomial(m, k)^2*x^k) +x*O(x^n)); polcoeff(A, n)} \\ Paul D. Hanna, Sep 05 2014
    
  • PARI
    {a(n)=local(A=1+x); A=sum(m=0, n, x^m*sum(k=0, n, binomial(m+k, k)^2*x^k) * (1-x)^(2*m+1) +x*O(x^n)); polcoeff(A, n)} \\ Paul D. Hanna, Sep 05 2014
    
  • PARI
    {a(n)=local(A=1+x); A=sum(m=0, n\2, x^(2*m) * sum(k=0, n, binomial(m+k, k)^2*x^k) +x*O(x^n)); polcoeff(A, n)} \\ Paul D. Hanna, Sep 05 2014
    
  • PARI
    {a(n)=local(A=1+x); A=sum(m=0, n\2, x^(2*m) * sum(k=0, m, binomial(m, k)^2*x^k) / (1-x +x*O(x^n))^(2*m+1) ); polcoeff(A, n)} \\ Paul D. Hanna, Sep 05 2014
    
  • Python
    from sympy import binomial
    def a(n): return sum(binomial(n - k, k)**2 for k in range(n//2 + 1))
    print([a(n) for n in range(31)]) # Indranil Ghosh, Apr 18 2017

Formula

G.f.: 1/sqrt(1 - 2*x - x^2 - 2*x^3 + x^4).
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)*(-1)^k*A002426(n-2k). - Paul Barry, Jan 31 2005
From Paul D. Hanna, May 22 2005: (Start)
a(n) = Sum_{k=0..n} C(n-k, k)^2.
Limit_{n->oo} a(n+1)/a(n) = (sqrt(5)+3)/2.
G.f.: 1/sqrt((1+x+x^2)*(1-3*x+x^2)). (End)
a(n) = Sum_{k=0..n} A049310(n, k)^2. - Philippe Deléham, Nov 21 2005
a(n) = Sum_{k=0..n} (C(k,k/2)*(1+(-1)^k)/2) * Sum_{j=0..n} (-1)^((n-j)/2)*C((n+j)/2,j)*((1+(-1)^(n-j))/2)*C(j,k). - Paul Barry, Mar 31 2010
G.f.: exp( Sum_{n>=1} (x^n/n)*Sum_{k=0..n} C(2n,2k)*x^k ). - Paul D. Hanna, Mar 18 2011
Logarithmic derivative equals A185828. - Paul D. Hanna, Mar 18 2011
D-finite with recurrence: n*a(n) - (2*n-1)*a(n-1) - (n-1)*a(n-2) - (2*n-3)*a(n-3) + (n-2)*a(n-4) = 0. - R. J. Mathar, Dec 17 2011
The g.f. A(x) satisfies the differential equation (1-2*x-x^2-2*x^3+x^4)*A'(x) = (1+x+3*x^2-2*x^3)*A(x), from which the recurrence conjectured by Mathar follows. - Emanuele Munarini, Dec 18 2017
a(n) ~ phi^(2*n + 2) / (2 * 5^(1/4) * sqrt(Pi*n)), where phi = A001622 = (1 + sqrt(5))/2 is the golden ratio. - Vaclav Kotesovec, Jan 05 2013, simplified Dec 18 2017
From Paul D. Hanna, Sep 05 2014: (Start)
G.f.: Sum_{n>=0} x^n * Sum_{k=0..n} C(n,k)^2 * x^k.
G.f.: Sum_{n>=0} x^n *[Sum_{k>=0} C(n+k,k)^2 * x^k] * (1-x)^(2*n+1).
G.f.: Sum_{n>=0} x^(2*n) * [Sum_{k>=0} C(n+k,k)^2 * x^k].
G.f.: Sum_{n>=0} x^(2*n) * [Sum_{k=0..n} C(n,k)^2 * x^k] /(1-x)^(2n+1).
(End)

A110320 Number of blocks in all RNA secondary structures with n nodes (an RNA secondary structure can be viewed as a restricted noncrossing partition).

Original entry on oeis.org

1, 2, 5, 13, 32, 80, 201, 505, 1273, 3217, 8146, 20668, 52531, 133726, 340909, 870213, 2223958, 5689807, 14571335, 37350585, 95821071, 246015677, 632088930, 1625119218, 4180845277, 10762096850, 27718352411, 71426753423, 184146711578
Offset: 1

Views

Author

Emeric Deutsch, Jul 19 2005

Keywords

Comments

Antidiagonal sums of A132812. - Philippe Deléham, Jun 08 2013

Examples

			a(4)=13 because the 4 (=A004148(4)) RNA secondary structures of size 4, namely 1/2/3/4, 13/2/4, 14/2/3 and 1/24/3, have altogether 4+3+3+3=13 blocks.
		

Crossrefs

Programs

  • Maple
    G:=1/2*(1-z-z^2)/z^2/(1-2*z-z^2-2*z^3+z^4)^(1/2)-1/2*1/(z^2): Gser:=series(G,z=0,37): seq(coeff(Gser,z^n),n=1..33);
  • Mathematica
    Table[Sum[Binomial[n-j+1,j]Binomial[n-j+1,j-1],{j, 0, n}],{n,1,25}] (* Benedict W. J. Irwin, Sep 24 2016 *)

Formula

G.f.: (1-z-z^2)/(2*z^2*sqrt(1-2*z-z^2-2*z^3+z^4))-1/(2*z^2).
a(n) = Sum_{k=1..n} k*A110319(n,k).
Conjecture: a(n) = (A051292(n+2)-A051286(n+1))/2. - Gerald McGarvey, Jan 14 2007
a(n) = (A051286(n+2)-A051286(n+1)-A051286(n))/2. - Benedict W. J. Irwin, Sep 24 2016
a(n) ~ sqrt(4 + 9/sqrt(5)) * (3+sqrt(5))^n / (sqrt(Pi*n) * 2^(n+1)). - Vaclav Kotesovec, Sep 25 2016, equivalently, a(n) ~ phi^(2*n + 3) / (2 * 5^(1/4) * sqrt(Pi*n)), where phi = A001622 is the golden ratio. - Vaclav Kotesovec, Dec 06 2021
D-finite with recurrence (n+2)*a(n) +3*(-n-1)*a(n-1) +(n-7)*a(n-3) +2*(2*n-3)*a(n-4) +(n-5)*a(n-5) +(-n+4)*a(n-6)=0. - R. J. Mathar, Feb 21 2020

A051291 Whitney number of level n of the lattice of the ideals of the fence of order 2 n + 1.

Original entry on oeis.org

1, 2, 3, 7, 17, 40, 97, 238, 587, 1458, 3640, 9124, 22951, 57904, 146461, 371281, 943045, 2399460, 6114555, 15603339, 39866932, 101976512, 261117378, 669239402, 1716737267, 4407306170, 11323050897, 29110603423, 74888578067
Offset: 0

Views

Author

Keywords

Comments

This is the second kind of Whitney numbers, which count elements, not to be confused with the first kind, which sum Mobius functions. - Thomas Zaslavsky, May 07 2008

Examples

			a(2) = 3 because the ideals of size 2 of the fence F(5) = { x1 < x2 > x3 < x4 > x5 } are x1x2, x1x3, x2x3.
		

References

  • E. Munarini, N. Zagaglia Salvi, On the Rank Polynomial of the Lattice of Order Ideals of Fences and Crowns, Discrete Mathematics 259 (2002), 163-177.

Crossrefs

Formula

G.f.: function = (1+2*t^2-t^3-(1-t)*sqrt(1-2*t-t^2-2*t^3+t^4))/(2*t*sqrt(1-2*t-t^2-2*t^3+t^4))

A098813 For a string of letters of length k, say abc...def, let f(k) be the string of length k-1 consisting of the adjacent pairs ab, bc, cd, ..., de, ef. Given n, let U be the string of length 2n consisting of n 1's followed by n 2's: 11...122...2. Then a(n) is the number of the C(2n,n) permutations V of U such that f(U) and f(V) agree in exactly one place.

Original entry on oeis.org

1, 1, 4, 19, 57, 178, 543, 1591, 4598, 13117, 36999, 103514, 287653, 794847, 2186054, 5988339, 16347999, 44497490, 120804023, 327217525, 884531586, 2386747391, 6429784509, 17296261734, 46465809007, 124678595953, 334173980818, 894778164125
Offset: 1

Views

Author

Zerinvary Lajos (with help from Miklos Kristof), Oct 07 2004

Keywords

Comments

The number of V's such that f(U) and f(V) agree in no positions gives the A051292(n+1) sequence (Whitney numbers): 1, 4, 9, 21, 52, 127, 313, 778, 1941, 4863, 12228, 30817, ...

Examples

			For n=1, U = 12 and only one V, 12 is a 1-match, so a(1)=1.
For n=2, U = 1122, f(U) = 11,12,22 and only one V, 2121 is a 1-match, with f(v) = 21,12,21, so a(2)=1.
For n=3, U = 111222 and only the four V's 112212, 121122, 121221 and 221211 are 1-matches, so a(3)=4.
		

Crossrefs

Cf. A051292.

Programs

  • Maple
    with(combinat): for n from 1 to 10 do y:=0:B:=array: M:=[seq(11,i=1..n-1),seq(12,i=n),seq(22,i=n+1..2*n-1)]: S:=[seq(i,i=1..2*n)]: L:=choose(S,n): for j from 1 to binomial(2*n,n) do for k from 1 to 2*n-1 do if member(k,L[j]) then B[k]:=10 else B[k]:=20 end if: if member(k+1,L[j]) then B[k]:=B[k]+1 else B[k]:=B[k]+2 end if end do: x:=0: for l from 1 to 2*n-1 do if B[l]=M[l] then x:=x+1 end if end do: if x=1 then y:=y+1 end if end do: print(y) end do: # Miklos Kristof, Oct 07 2004
  • Python
    def find(bits_in, n0, n1, match):
        global count, U
        bitsleft = n0 + n1
        if bitsleft==0:
            if match:
                count += 1
        else:
            bitsleft -= 1
            if n0 > 0:
                bits_out = bits_in<<1
                new_match = (bits_out&3) == ((U >> bitsleft)&3)
                if not (match and new_match):
                    find(bits_out, n0-1, n1, match or new_match)
            if n1 > 0:
                bits_out = (bits_in<<1)|1;
                new_match = (bits_out&3) == ((U >> bitsleft)&3)
                if not (match and new_match):
                    find(bits_out, n0, n1-1, match or new_match)
    def A098813(n):
        global count, U
        count = 0 ; U = (1<Bert Dobbelaere, Dec 23 2018

Extensions

a(13)-a(15) from Ray Chandler, Oct 25 2004
a(16)-a(28) from Bert Dobbelaere, Dec 24 2018

A205810 Irregular triangle read by rows: Whitney numbers c_{n,k} (n >= 0, 0 <= k <= 2n) of Lucas lattices.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 3, 3, 4, 3, 3, 1, 1, 4, 6, 8, 9, 8, 6, 4, 1, 1, 5, 10, 15, 20, 21, 20, 15, 10, 5, 1, 1, 6, 15, 26, 39, 48, 52, 48, 39, 26, 15, 6, 1, 1, 7, 21, 42, 70, 98, 119, 127, 119, 98, 70, 42, 21, 7, 1
Offset: 0

Views

Author

N. J. A. Sloane, Jan 31 2012

Keywords

Examples

			Triangle begins:
  1;
  1, 1,  1;
  1, 2,  1,  2,  1;
  1, 3,  3,  4,  3,  3,   1;
  1, 4,  6,  8,  9,  8,   6,   4,   1;
  1, 5, 10, 15, 20, 21,  20,  15,  10,  5,  1;
  1, 6, 15, 26, 39, 48,  52,  48,  39, 26, 15,  6,  1;
  1, 7, 21, 42, 70, 98, 119, 127, 119, 98, 70, 42, 21, 7, 1;
  ...
		

Crossrefs

Main diagonal is A051292.

Programs

  • Maple
    c:= (n, k)-> `if`(k=2*n, 1, n*add(1/(n-i)*binomial(n-i, n-k+i)*binomial(k-i-1, i), i=0..floor(k/2))): seq(seq(c(n, k), k=0..2*n), n=0..8);  # Leonid Bedratyuk, May 15 2018
  • PARI
    T(n,k) = if (k==2*n, 1, n*sum(i=0, k\2, 1/(n-i)*binomial(n-i,n-k+i)*binomial(k-i-1,i)));
    tabf(nn) = for (n=0, nn, for (k=0, 2*n, print1(T(n,k), ", ")); print); \\ Michel Marcus, May 16 2018

Formula

c(n, k) = n*Sum_{i = 0..floor(k/2)} 1/(n-i)*binomial(n-i, n-k+i)*binomial(k-i-1, i) for 0 <= k <= 2*n-1; c(n, 2*n) = 1. - Leonid Bedratyuk, May 15 2018
From Peter Bala, Jun 26 2025: (Start)
For n >= 1, the n-th row polynomial R(n, x) = x^n * t(n, 1 + x + 1/x), where t(n, x) = 2*Chebyshev_T(n, x/2) (AlSukaiti and Chbili, Proposition 2.1).
Conjecture: for n >= 1, t(n, x + 1) = Sum_{k = 0..n} c(n, n-k)*t(k, x) - c(n, n). Cf. A097724. (End)

A099793 Table read by rows where row n consists of 2n terms representing k-matches described in A098813.

Original entry on oeis.org

1, 1, 4, 1, 0, 1, 9, 4, 5, 1, 0, 1, 21, 19, 12, 9, 7, 1, 0, 1, 52, 57, 53, 47, 16, 16, 9, 1, 0, 1, 127, 178, 202, 154, 120, 85, 20, 25, 11, 1, 0, 1, 313, 543, 664, 636, 525, 310, 233, 133, 24, 36, 13, 1, 0, 1, 778, 1591, 2204, 2355, 2007, 1621, 1076, 549, 404, 191, 28, 49, 15
Offset: 1

Views

Author

Zerinvary Lajos and Ray Chandler, Oct 26 2004

Keywords

Comments

For a string of letters of length k, say abc...def, let f(k) be the string of length k-1 consisting of the adjacent pairs ab, bc, cd, ..., de, ef. Given n, let U be the string of length 2n consisting of n 1's followed by n 2's: 11...122...2. Then T(n,k) = number of the C(2n,n) permutations V of U such that f(U) and f(V) agree in exactly k places, 0<=k<=2n-1.

Examples

			Table begins:
1: 1,1,
2: 4,1,0,1,
3: 9,4,5,1,0,1,
4: 21,19,12,9,7,1,0,1,
5: 52,57,53,47,16,16,9,1,0,1,
6: 127,178,202,154,120,85,20,25,11,1,0,1,
7: 313,543,664,636,525,310,233,133,24,36,13,1,0,1,
8: 778,1591,2204,2355,2007,1621,1076,549,404,191,28,49,15,1,0,1,
9: 1941,4598,7091,8223,8036,6722,4721,3457,1911,901,645,259,32,64,17,1,0,1
		

Crossrefs

First column is A051292(n+1); second column is A098813; row sums = A000984.

A125226 Array, read by antidiagonals, where A(1,1) = A(1,2) = A(2,1) = A(2,2) = 1, A(n,k) = 0 if n<1 or k<1, otherwise A(n,k) = A(n-2,k-2) + A(n-1,k-2) + A(n-2,k-1) + A(n-1,k-1).

Original entry on oeis.org

1, 1, 1, 0, 1, 0, 0, 2, 2, 0, 0, 1, 4, 1, 0, 0, 0, 4, 4, 0, 0, 0, 0, 3, 9, 3, 0, 0, 0, 0, 1, 11, 11, 1, 0, 0, 0, 0, 0, 8, 21, 8, 0, 0, 0, 0, 0, 0, 4, 27, 27, 4, 0, 0, 0, 0, 0, 0, 1, 23, 52, 23, 1, 0, 0, 0, 0, 0, 0, 0, 13, 67, 67, 13, 0, 0, 0, 0, 0, 0, 0, 0, 5, 62, 127, 62, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 41
Offset: 1

Views

Author

Gerald McGarvey, Jan 14 2007

Keywords

Comments

It appears that the main diagonal (1,1,4,9,21,...) is A051292 (Whitney number of level n of the lattice of the ideals of the crown of size 2 n). It appears that if b(n) = the n-th antidiagonal sum - A108014(n-1) then the sequence b(n) is the sequence 1,0,-2,0,1,0 repeated. n-th row sum = A052945(n).

Examples

			Array begins:
  1 1 0 0 0 0 0 ...
  1 1 2 1 0 0 0 ...
  0 2 4 4 3 1 0 ...
  ...
		

Crossrefs

Programs

  • PARI
    A=matrix(22,22);A[1,1]=1;A[1,2]=1;A[2,1]=1;A[2,2]=1;A[3,2]=2;A[2,3]=2;A[2,4]=1;A[4,2]=1; for(n=3,22,for(k=3,22,A[n,k]=A[n-2,k-2]+A[n-1,k-2]+A[n-2,k-1]+A[n-1,k-1])); for(n=1,22,for(i=1,n,print1(A[n-i+1,i],", ")))

Formula

A(1,1) = A(1,2) = A(2,1) = A(2,2) = 1, A(n,k) = 0 if n<1 or k<1, otherwise A(n,k) = A(n-2,k-2) + A(n-1,k-2) + A(n-2,k-1) + A(n-1,k-1)
Showing 1-8 of 8 results.