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-10 of 48 results. Next

A345908 Traces of the matrices (A345197) counting integer compositions by length and alternating sum.

Original entry on oeis.org

1, 1, 0, 1, 3, 3, 6, 15, 24, 43, 92, 171, 315, 629, 1218, 2313, 4523, 8835, 17076, 33299, 65169
Offset: 0

Views

Author

Gus Wiseman, Jul 26 2021

Keywords

Comments

The matrices (A345197) count the integer compositions of n of length k with alternating sum i, where 1 <= k <= n, and i ranges from -n + 2 to n in steps of 2. Here, the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. So a(n) is the number of compositions of n of length (n + s)/2, where s is the alternating sum of the composition.

Examples

			The a(0) = 1 through a(7) = 15 compositions of n = 0..7 of length (n + s)/2 where s = alternating sum (empty column indicated by dot):
  ()  (1)  .  (2,1)  (2,2)    (2,3)    (2,4)      (2,5)
                     (1,1,2)  (1,2,2)  (1,3,2)    (1,4,2)
                     (2,1,1)  (2,2,1)  (2,3,1)    (2,4,1)
                                       (1,1,3,1)  (1,1,3,2)
                                       (2,1,2,1)  (1,2,3,1)
                                       (3,1,1,1)  (2,1,2,2)
                                                  (2,2,2,1)
                                                  (3,1,1,2)
                                                  (3,2,1,1)
                                                  (1,1,1,1,3)
                                                  (1,1,2,1,2)
                                                  (1,1,3,1,1)
                                                  (2,1,1,1,2)
                                                  (2,1,2,1,1)
                                                  (3,1,1,1,1)
		

Crossrefs

Traces of the matrices given by A345197.
Diagonals and antidiagonals of the same matrices are A346632 and A345907.
Row sums of A346632.
A011782 counts compositions.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A316524 gives the alternating sum of prime indices (reverse: A344616).
Other diagonals are A008277 of A318393 and A055884 of A320808.
Compositions of n, 2n, or 2n+1 with alternating/reverse-alternating sum k:
- k = 0: counted by A088218, ranked by A344619/A344619.
- k = 1: counted by A000984, ranked by A345909/A345911.
- k = -1: counted by A001791, ranked by A345910/A345912.
- k = 2: counted by A088218, ranked by A345925/A345922.
- k = -2: counted by A002054, ranked by A345924/A345923.
- k >= 0: counted by A116406, ranked by A345913/A345914.
- k <= 0: counted by A058622(n-1), ranked by A345915/A345916.
- k > 0: counted by A027306, ranked by A345917/A345918.
- k < 0: counted by A294175, ranked by A345919/A345920.
- k != 0: counted by A058622, ranked by A345921/A345921.
- k even: counted by A081294, ranked by A053754/A053754.
- k odd: counted by A000302, ranked by A053738/A053738.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[#]==(n+ats[#])/2&]],{n,0,15}]

A345907 Triangle giving the main antidiagonals of the matrices counting integer compositions by length and alternating sum (A345197).

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 2, 2, 1, 1, 0, 0, 4, 3, 1, 1, 0, 0, 3, 6, 4, 1, 1, 0, 0, 6, 9, 8, 5, 1, 1, 0, 0, 0, 18, 18, 10, 6, 1, 1, 0, 0, 0, 10, 36, 30, 12, 7, 1, 1, 0, 0, 0, 20, 40, 60, 45, 14, 8, 1, 1, 0, 0, 0, 0, 80, 100, 90, 63, 16, 9, 1, 1
Offset: 0

Views

Author

Gus Wiseman, Jul 26 2021

Keywords

Comments

The matrices (A345197) count the integer compositions of n of length k with alternating sum i, where 1 <= k <= n, and i ranges from -n + 2 to n in steps of 2. Here, the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.
Problem: What are the column sums? They appear to match A239201, but it is not clear why.

Examples

			Triangle begins:
   1
   1   1
   0   1   1
   0   1   1   1
   0   2   2   1   1
   0   0   4   3   1   1
   0   0   3   6   4   1   1
   0   0   6   9   8   5   1   1
   0   0   0  18  18  10   6   1   1
   0   0   0  10  36  30  12   7   1   1
   0   0   0  20  40  60  45  14   8   1   1
   0   0   0   0  80 100  90  63  16   9   1   1
   0   0   0   0  35 200 200 126  84  18  10   1   1
   0   0   0   0  70 175 400 350 168 108  20  11   1   1
   0   0   0   0   0 350 525 700 560 216 135  22  12   1   1
		

Crossrefs

Row sums are A163493.
Rows are the antidiagonals of the matrices given by A345197.
The main diagonals of A345197 are A346632, with sums A345908.
A011782 counts compositions.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A316524 gives the alternating sum of prime indices (reverse: A344616).
Other diagonals are A008277 of A318393 and A055884 of A320808.
Compositions of n, 2n, or 2n+1 with alternating/reverse-alternating sum k:
- k = 0: counted by A088218, ranked by A344619/A344619.
- k = 1: counted by A000984, ranked by A345909/A345911.
- k = -1: counted by A001791, ranked by A345910/A345912.
- k = 2: counted by A088218, ranked by A345925/A345922.
- k = -2: counted by A002054, ranked by A345924/A345923.
- k >= 0: counted by A116406, ranked by A345913/A345914.
- k <= 0: counted by A058622(n-1), ranked by A345915/A345916.
- k > 0: counted by A027306, ranked by A345917/A345918.
- k < 0: counted by A294175, ranked by A345919/A345920.
- k != 0: counted by A058622, ranked by A345921/A345921.
- k even: counted by A081294, ranked by A053754/A053754.
- k odd: counted by A000302, ranked by A053738/A053738.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{n-k}],k==(n+ats[#])/2-1&]],{k,0,n-1}],{n,0,15}]

A346632 Triangle read by rows giving the main diagonals of the matrices counting integer compositions by length and alternating sum (A345197).

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 0, 1, 2, 3, 0, 0, 0, 1, 2, 6, 6, 0, 0, 0, 1, 2, 9, 12, 0, 0, 0, 0, 1, 2, 12, 18, 10, 0, 0, 0, 0, 1, 2, 15, 24, 30, 20, 0, 0, 0, 0, 1, 2, 18, 30, 60, 60, 0, 0, 0, 0, 0, 1, 2, 21, 36, 100, 120, 35, 0, 0, 0, 0
Offset: 0

Views

Author

Gus Wiseman, Jul 26 2021

Keywords

Comments

The matrices (A345197) count the integer compositions of n of length k with alternating sum i, where 1 <= k <= n, and i ranges from -n + 2 to n in steps of 2. The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			Triangle begins:
   1
   0   0
   0   1   0
   0   1   2   0
   0   1   2   0   0
   0   1   2   3   0   0
   0   1   2   6   6   0   0
   0   1   2   9  12   0   0   0
   0   1   2  12  18  10   0   0   0
   0   1   2  15  24  30  20   0   0   0
   0   1   2  18  30  60  60   0   0   0   0
   0   1   2  21  36 100 120  35   0   0   0   0
   0   1   2  24  42 150 200 140  70   0   0   0   0
   0   1   2  27  48 210 300 350 280   0   0   0   0   0
   0   1   2  30  54 280 420 700 700 126   0   0   0   0   0
		

Crossrefs

The first nonzero element in each column appears to be A001405.
These are the diagonals of the matrices given by A345197.
Antidiagonals of the same matrices are A345907.
Row sums are A345908.
A011782 counts compositions.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A316524 gives the alternating sum of prime indices (reverse: A344616).
Other diagonals are A008277 of A318393 and A055884 of A320808.
Compositions of n, 2n, or 2n+1 with alternating/reverse-alternating sum k:
- k = 0: counted by A088218, ranked by A344619/A344619.
- k = 1: counted by A000984, ranked by A345909/A345911.
- k = -1: counted by A001791, ranked by A345910/A345912.
- k = 2: counted by A088218, ranked by A345925/A345922.
- k = -2: counted by A002054, ranked by A345924/A345923.
- k >= 0: counted by A116406, ranked by A345913/A345914.
- k <= 0: counted by A058622(n-1), ranked by A345915/A345916.
- k > 0: counted by A027306, ranked by A345917/A345918.
- k < 0: counted by A294175, ranked by A345919/A345920.
- k != 0: counted by A058622, ranked by A345921/A345921.
- k even: counted by A081294, ranked by A053754/A053754.
- k odd: counted by A000302, ranked by A053738/A053738.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{k}],k==(n+ats[#])/2&]],{k,n}],{n,0,15}]

A088218 Total number of leaves in all rooted ordered trees with n edges.

Original entry on oeis.org

1, 1, 3, 10, 35, 126, 462, 1716, 6435, 24310, 92378, 352716, 1352078, 5200300, 20058300, 77558760, 300540195, 1166803110, 4537567650, 17672631900, 68923264410, 269128937220, 1052049481860, 4116715363800, 16123801841550, 63205303218876, 247959266474052
Offset: 0

Views

Author

Michael Somos, Sep 24 2003

Keywords

Comments

Essentially the same as A001700, which has more information.
Note that the unique rooted tree with no edges has no leaves, so a(0)=1 is by convention. - Michael Somos, Jul 30 2011
Number of ordered partitions of n into n parts, allowing zeros (cf. A097070) is binomial(2*n-1,n) = a(n) = essentially A001700. - Vladeta Jovovic, Sep 15 2004
Hankel transform is A000027; example: Det([1,1,3,10;1,3,10,35;3,10,35,126; 10,35,126,462]) = 4. - Philippe Deléham, Apr 13 2007
a(n) is the number of functions f:[n]->[n] such that for all x,y in [n] if xA045992(n). - Geoffrey Critzer, Apr 02 2009
Hankel transform of the aeration of this sequence is A000027 doubled: 1,1,2,2,3,3,... - Paul Barry, Sep 26 2009
The Fi1 and Fi2 triangle sums of A039599 are given by the terms of this sequence. For the definitions of these triangle sums see A180662. - Johannes W. Meijer, Apr 20 2011
Alternating row sums of Riordan triangle A094527. See the Philippe Deléham formula. - Wolfdieter Lang, Nov 22 2012
(-2)*a(n) is the Z-sequence for the Riordan triangle A110162. For the notion of Z- and A-sequences for Riordan arrays see the W. Lang link under A006232 with details and references. - Wolfdieter Lang, Nov 22 2012
From Gus Wiseman, Jun 27 2021: (Start)
Also the number of integer compositions of 2n with alternating (or reverse-alternating) sum 0 (ranked by A344619). This is equivalent to Ran Pan's comment at A001700. For example, the a(0) = 1 through a(3) = 10 compositions are:
() (11) (22) (33)
(121) (132)
(1111) (231)
(1122)
(1221)
(2112)
(2211)
(11121)
(12111)
(111111)
For n > 0, a(n) is also the number of integer compositions of 2n with alternating sum 2.
(End)
Number of terms in the expansion of (x_1+x_2+...+x_n)^n. - César Eliud Lozada, Jan 08 2022

Examples

			G.f. = 1 + x + 3*x^2 + 10*x^3 + 35*x^4 + 126*x^5 + 462*x^6 + 1716*x^7 + ...
The five rooted ordered trees with 3 edges have 10 leaves.
..x........................
..o..x.x..x......x.........
..o...o...o.x..x.o..x.x.x..
..r...r....r....r.....r....
		

References

  • L. W. Shapiro and C. J. Wang, Generating identities via 2 X 2 matrices, Congressus Numerantium, 205 (2010), 33-46.

Crossrefs

Same as A001700 modulo initial term and offset.
First differences are A024718.
Main diagonal of A071919 and of A305161.
A signed version is A110556.
A000041 counts partitions of 2n with alternating sum 0, ranked by A000290.
A003242 counts anti-run compositions.
A025047 counts wiggly compositions (ascend: A025048, descend: A025049).
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A106356 counts compositions by number of maximal anti-runs.
A124754 gives the alternating sum of standard compositions.
A345197 counts compositions by sum, length, and alternating sum.
Compositions of n, 2n, or 2n+1 with alternating/reverse-alternating sum k:
- k = 0: counted by A088218 (this sequence), ranked by A344619/A344619.
- k = 1: counted by A000984, ranked by A345909/A345911.
- k = -1: counted by A001791, ranked by A345910/A345912.
- k = 2: counted by A088218 (this sequence), ranked by A345925/A345922.
- k = -2: counted by A002054, ranked by A345924/A345923.
- k >= 0: counted by A116406, ranked by A345913/A345914.
- k <= 0: counted by A058622(n-1), ranked by A345915/A345916.
- k > 0: counted by A027306, ranked by A345917/A345918.
- k < 0: counted by A294175, ranked by A345919/A345920.
- k != 0: counted by A058622, ranked by A345921/A345921.
- k even: counted by A081294, ranked by A053754/A053754.
- k odd: counted by A000302, ranked by A053738/A053738.

Programs

  • Magma
    [Binomial(2*n-1, n): n in [0..30]]; // Vincenzo Librandi, Aug 07 2014
  • Maple
    seq(binomial(2*n-1, n),n=0..24); # Peter Luschny, Sep 22 2014
  • Mathematica
    a[ n_] := SeriesCoefficient[(1 - x)^-n, {x, 0, n}];
    c = (1 - (1 - 4 x)^(1/2))/(2 x);CoefficientList[Series[1/(1-(c-1)),{x,0,20}],x] (* Geoffrey Critzer, Dec 02 2010 *)
    Table[Binomial[2 n - 1, n], {n, 0, 20}] (* Vincenzo Librandi, Aug 07 2014 *)
    a[ n_] := If[ n < 0, 0, With[ {m = 2 n}, m! SeriesCoefficient[ (1 + BesselI[0, 2 x]) / 2, {x, 0, m}]]]; (* Michael Somos, Nov 22 2014 *)
  • PARI
    {a(n) = sum( i=0, n, binomial(n+i-2,i))};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (1 + 1 / sqrt(1 - 4*x + x * O(x^n))) / 2, n))};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( 1 / (1 - x + x * O(x^n))^n, n))};
    
  • PARI
    {a(n) = if( n<0, 0, binomial( 2*n - 1, n))};
    
  • PARI
    {a(n) = if( n<1, n==0, polcoeff( subst((1 - x) / (1 - 2*x), x, serreverse( x - x^2 + x * O(x^n))), n))};
    
  • Sage
    def A088218(n):
        return rising_factorial(n,n)/falling_factorial(n,n)
    [A088218(n) for n in (0..24)]  # Peter Luschny, Nov 21 2012
    

Formula

G.f.: (1 + 1 / sqrt(1 - 4*x)) / 2.
a(n) = binomial(2*n - 1, n).
a(n) = (n+1)*A000108(n)/2, n>=1. - B. Dubalski (dubalski(AT)atr.bydgoszcz.pl), Feb 05 2002 (in A060150)
a(n) = (0^n + C(2n, n))/2. - Paul Barry, May 21 2004
a(n) is the coefficient of x^n in 1 / (1 - x)^n and also the sum of the first n coefficients of 1 / (1 - x)^n. Given B(x) with the property that the coefficient of x^n in B(x)^n equals the sum of the first n coefficients of B(x)^n, then B(x) = B(0) / (1 - x).
G.f.: 1 / (2 - C(x)) = (1 - x*C(x))/sqrt(1-4*x) where C(x) is g.f. for Catalan numbers A000108. Second equation added by Wolfdieter Lang, Nov 22 2012.
From Paul Barry, Nov 02 2004: (Start)
a(n) = Sum_{k=0..n} binomial(2*n, k)*cos((n-k)*Pi);
a(n) = Sum_{k=0..n} binomial(n, (n-k)/2)*(1+(-1)^(n-k))*cos(k*Pi/2)/2 (with interpolated zeros);
a(n) = Sum_{k=0..floor(n/2)} binomial(n, k)*cos((n-2*k)*Pi/2) (with interpolated zeros); (End)
a(n) = A110556(n)*(-1)^n, central terms in triangle A110555. - Reinhard Zumkeller, Jul 27 2005
a(n) = Sum_{0<=k<=n} A094527(n,k)*(-1)^k. - Philippe Deléham, Mar 14 2007
From Paul Barry, Mar 29 2010: (Start)
G.f.: 1/(1-x/(1-2x/(1-(1/2)x/(1-(3/2)x/(1-(2/3)x/(1-(4/3)x/(1-(3/4)x/(1-(5/4)x/(1-... (continued fraction);
E.g.f.: (of aerated sequence) (1 + Bessel_I(0, 2*x))/2. (End)
a(n + 1) = A001700(n). a(n) = A024718(n) - A024718(n - 1).
E.g.f.: E(x) = 1+x/(G(0)-2*x) ; G(k) = (k+1)^2+2*x*(2*k+1)-2*x*(2*k+3)*((k+1)^2)/G(k+1); (continued fraction). - Sergei N. Gladkovskii, Dec 21 2011
a(n) = Sum_{k=0..n}(-1)^k*binomial(2*n,n+k). - Mircea Merca, Jan 28 2012
a(n) = rf(n,n)/ff(n,n), where rf is the rising factorial and ff the falling factorial. - Peter Luschny, Nov 21 2012
D-finite with recurrence: n*a(n) +2*(-2*n+1)*a(n-1) = 0. - R. J. Mathar, Dec 04 2012
a(n) = hypergeom([1-n,-n],[1],1). - Peter Luschny, Sep 22 2014
G.f.: 1 + x/W(0), where W(k) = 4*k+1 - (4*k+3)*x/(1 - (4*k+1)*x/(4*k+3 - (4*k+5)*x/(1 - (4*k+3)*x/W(k+1) ))) ; (continued fraction). - Sergei N. Gladkovskii, Nov 13 2014
a(n) = A000984(n) + A001791(n). - Gus Wiseman, Jun 28 2021
E.g.f.: (1 + exp(2*x) * BesselI(0,2*x)) / 2. - Ilya Gutkovskiy, Nov 03 2021
From Amiram Eldar, Mar 12 2023: (Start)
Sum_{n>=0} 1/a(n) = 5/3 + 4*Pi/(9*sqrt(3)).
Sum_{n>=0} (-1)^n/a(n) = 3/5 - 8*log(phi)/(5*sqrt(5)), where phi is the golden ratio (A001622). (End)
a(n) ~ 2^(2*n-1)/sqrt(n*Pi). - Stefano Spezia, Apr 17 2024

A097805 Number of compositions of n with k parts, T(n, k) = binomial(n-1, k-1) for n, k >= 1 and T(n, 0) = 0^n, triangle read by rows for n >= 0 and 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 3, 1, 0, 1, 4, 6, 4, 1, 0, 1, 5, 10, 10, 5, 1, 0, 1, 6, 15, 20, 15, 6, 1, 0, 1, 7, 21, 35, 35, 21, 7, 1, 0, 1, 8, 28, 56, 70, 56, 28, 8, 1, 0, 1, 9, 36, 84, 126, 126, 84, 36, 9, 1, 0, 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1, 0, 1, 11, 55, 165, 330, 462, 462, 330, 165, 55, 11, 1
Offset: 0

Views

Author

Paul Barry, Aug 25 2004

Keywords

Comments

Previous name was: Riordan array (1, 1/(1-x)) read by rows.
Note this Riordan array would be denoted (1, x/(1-x)) by some authors.
Columns have g.f. (x/(1-x))^k. Reverse of A071919. Row sums are A011782. Antidiagonal sums are Fibonacci(n-1). Inverse as Riordan array is (1, 1/(1+x)). A097805=B*A059260*B^(-1), where B is the binomial matrix.
(0,1)-Pascal triangle. - Philippe Deléham, Nov 21 2006
(n+1) * each term of row n generates triangle A127952: (1; 0, 2; 0, 3, 3; 0, 4, 8, 4; ...). - Gary W. Adamson, Feb 09 2007
Triangle T(n,k), 0<=k<=n, read by rows, given by [0,1,0,0,0,0,0,...] DELTA [1,0,0,0,0,0,0,...] where DELTA is the operator defined in A084938. - Philippe Deléham, Dec 12 2008
From Paul Weisenhorn, Feb 09 2011: (Start)
Triangle read by rows: T(r,c) is the number of unordered partitions of n=r*(r+1)/2+c into (r+1) parts < (r+1) and at most pairs of equal parts and parts in neighboring pairs have difference 2.
Triangle read by rows: T(r,c) is the number of unordered partitions of the number n=r*(r+1)/2+(c-1) into r parts < (r+1) and at most pairs of equal parts and parts in neighboring pairs have difference 2. (End)
Triangle read by rows: T(r,c) is the number of ordered partitions (compositions) of r into c parts. - Juergen Will, Jan 04 2016
From Tom Copeland, Oct 25 2012: (Start)
Given a basis composed of a sequence of polynomials p_n(x) characterized by ladder (creation / annihilation, or raising / lowering) operators defined by R p_n(x) = p_(n+1)(x) and L p_n(x) = n p_(n-1)(x) with p_0(x)=1, giving the number operator # p_n(x) = RL p_n(x) = n p_n(x), the lower triangular padded Pascal matrix Pd (A097805) serves as a matrix representation of the operator exp(R^2*L) = exp(R#) =
1) exp(x^2D) for the set x^n and
2) D^(-1) exp(t*x)D for the set x^n/n! (see A218234).
(End)
From James East, Apr 11 2014: (Start)
Square array a(m,n) with m,n=0,1,2,... read by off-diagonals.
a(m,n) gives the number of order-preserving functions f:{1,...,m}->{1,...,n}. Order-preserving means that x
a(n,n)=A088218(n) is the size of the semigroup O_n of all order-preserving transformations of {1,...,n}.
Read as a triangle, this sequence may be obtained by augmenting Pascal's triangle by appending the column 1,0,0,0,... on the left.
(End)
A formula based on the partitions of n with largest part k is given as a Sage program below. The 'conjugate' formula leads to A048004. - Peter Luschny, Jul 13 2015
From Wolfdieter Lang, Feb 17 2017: (Start)
The transposed of this lower triangular Riordan matrix of the associated type T provides the transition matrix between the monomial basis {x^n}, n >= 0, and the basis {y^n}, n >= 0, with y = x/(1-x): x^0 = 1 = y^0, x^n = Sum_{m >= n} Ttrans(n,m) y^m, for n >= 1, with Ttrans(n,m) = binomial(m-1,n-1).
Therefore, if a transformation with this Riordan matrix from a sequence {a} to the sequence {b} is given by b(n) = Sum_{m=0..n} T(n, m)*a(m), with T(n, m) = binomial(n-1, m-1), for n >= 1, then Sum_{n >= 0} a(n)*x^n = Sum_{n >= 0} b(n)*y^n, with y = x/(1-x) and vice versa. This is a modified binomial transformation; the usual one belongs to the Pascal Riordan matrix A007318. (End)
From Gus Wiseman, Jan 23 2022: (Start)
Also the number of compositions of n with alternating sum k, with k ranging from -n to n in steps of 2. For example, row n = 6 counts the following compositions (empty column indicated by dot):
. (15) (24) (33) (42) (51) (6)
(141) (132) (123) (114)
(1113) (231) (222) (213)
(1212) (1122) (321) (312)
(1311) (1221) (1131) (411)
(2112) (2121)
(2211) (3111)
(11121) (11112)
(12111) (11211)
(111111) (21111)
The reverse-alternating version is the same. Counting compositions by all three parameters (sum, length, alternating sum) gives A345197. Compositions of 2n with alternating sum 2k with k ranging from -n + 1 to n are A034871. (End)
Also the convolution triangle of A000012. - Peter Luschny, Oct 07 2022
From Sergey Kitaev, Nov 18 2023: (Start)
Number of permutations of length n avoiding simultaneously the patterns 123 and 132 with k right-to-left maxima. A right-to-left maximum in a permutation a(1)a(2)...a(n) is position i such that a(j) < a(i) for all i < j.
Number of permutations of length n avoiding simultaneously the patterns 231 and 312 with k right-to-left minima (resp., left-to-right maxima). A right-to-left minimum (resp., left-to-right maximum) in a permutation a(1)a(2)...a(n) is position i such that a(j) > a(i) for all j > i (resp., a(j) < a(i) for all j < i).
Number of permutations of length n avoiding simultaneously the patterns 213 and 312 with k right-to-left maxima (resp., left-to-right maxima).
Number of permutations of length n avoiding simultaneously the patterns 213 and 231 with k right-to-left maxima (resp., right-to-left minima). (End)

Examples

			G.f. = 1 + x * (x + x^3 * (1 + x) + x^6 * (1 + x)^2 + x^10 * (1 + x)^3 + ...). - _Michael Somos_, Aug 20 2006
The triangle T(n, k) begins:
n\k  0 1 2  3  4   5   6  7  8 9 10 ...
0:   1
1:   0 1
2:   0 1 1
3:   0 1 2  1
4:   0 1 3  3  1
5:   0 1 4  6  4   1
6:   0 1 5 10 10   5   1
7:   0 1 6 15 20  15   6  1
8:   0 1 7 21 35  35  21  7  1
9:   0 1 8 28 56  70  56 28  8 1
10:  0 1 9 36 84 126 126 84 36 9  1
... reformatted _Wolfdieter Lang_, Jul 31 2017
From _Paul Weisenhorn_, Feb 09 2011: (Start)
T(r=5,c=3) = binomial(4,2) = 6 unordered partitions of the number n = r*(r+1)/2+c = 18 with (r+1)=6 summands: (5+5+4+2+1+1), (5+5+3+3+1+1), (5+4+4+3+1+1), (5+5+3+2+2+1), (5+4+4+2+2+1), (5+4+3+3+2+1).
T(r=5,c=3) = binomial(4,2) = 6 unordered partitions of the number n = r*(r+1)/2+(c-1) = 17 with r=5 summands: (5+5+4+2+1), (5+5+3+3+1), (5+5+3+2+2), (5+4+4+3+1), (5+4+4+2+2), (5+4+3+3+2).  (End)
From _James East_, Apr 11 2014: (Start)
a(0,0)=1 since there is a unique (order-preserving) function {}->{}.
a(m,0)=0 for m>0 since there is no function from a nonempty set to the empty set.
a(3,2)=4 because there are four order-preserving functions {1,2,3}->{1,2}: these are [1,1,1], [2,2,2], [1,1,2], [1,2,2]. Here f=[a,b,c] denotes the function defined by f(1)=a, f(2)=b, f(3)=c.
a(2,3)=6 because there are six order-preserving functions {1,2}->{1,2,3}: these are [1,1], [1,2], [1,3], [2,2], [2,3], [3,3].
(End)
		

References

  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Part 1, Section 7.2.1.3, 2011.

Crossrefs

Case m=0 of the polynomials defined in A278073.
Cf. A000012 (diagonal), A011782 (row sums), A088218 (central terms).
The terms just left of center in odd-indexed rows are A001791, even A002054.
The odd-indexed rows are A034871.
Row sums without the center are A058622.
The unordered version is A072233, without zeros A008284.
Right half without center has row sums A027306(n-1).
Right half with center has row sums A116406(n).
Left half without center has row sums A294175(n-1).
Left half with center has row sums A058622(n-1).
A025047 counts alternating compositions.
A098124 counts balanced compositions, unordered A047993.
A106356 counts compositions by number of maximal anti-runs.
A344651 counts partitions by sum and alternating sum.
A345197 counts compositions by sum, length, and alternating sum.

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0,
          expand(add(b(n-i*j, i-1, p+j)/j!*x^j, j=0..n/i))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n$2, 0)):
    seq(T(n), n=0..20);  # Alois P. Heinz, May 25 2014
    # Alternatively:
    T := proc(k,n) option remember;
    if k=n then 1 elif k=0 then 0 else
    add(T(k-1,n-i), i=1..n-k+1) fi end:
    A097805 := (n,k) -> T(k,n):
    for n from 0 to 12 do seq(A097805(n,k), k=0..n) od; # Peter Luschny, Mar 12 2016
    # Uses function PMatrix from A357368.
    PMatrix(10, n -> 1);  # Peter Luschny, Oct 07 2022
  • Mathematica
    T[0, 0] = 1; T[n_, k_] := Binomial[n-1, k-1]; Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Sep 03 2014, after Paul Weisenhorn *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[#]==k&]],{n,0,10},{k,0,n}] (* Gus Wiseman, Jan 23 2022 *)
  • PARI
    {a(n) = my(m); if( n<2, n==0, n--; m = (sqrtint(8*n + 1) - 1)\2; binomial(m-1, n - m*(m + 1)/2))}; /* Michael Somos, Aug 20 2006 */
    
  • PARI
    T(n,k) = if (k==0, 0^n, binomial(n-1, k-1)); \\ Michel Marcus, May 06 2022
    
  • PARI
    row(n) = vector(n+1, k, k--; if (k==0, 0^n, binomial(n-1, k-1))); \\ Michel Marcus, May 06 2022
    
  • Python
    from math import comb
    def T(n, k): return comb(n-1, k-1) if k != 0 else k**n  # Peter Luschny, May 06 2022
  • Sage
    # Illustrates a basic partition formula, is not efficient as a program for large n.
    def A097805_row(n):
        r = []
        for k in (0..n):
            s = 0
            for q in Partitions(n, max_part=k, inner=[k]):
                s += mul(binomial(q[j],q[j+1]) for j in range(len(q)-1))
            r.append(s)
        return r
    [A097805_row(n) for n in (0..9)] # Peter Luschny, Jul 13 2015
    

Formula

Number triangle T(n, k) defined by T(n,k) = Sum_{j=0..n} binomial(n, j)*if(k<=j, (-1)^(j-k), 0).
T(r,c) = binomial(r-1,c-1), 0 <= c <= r. - Paul Weisenhorn, Feb 09 2011
G.f.: (-1+x)/(-1+x+x*y). - R. J. Mathar, Aug 11 2015
a(0,0) = 1, a(n,k) = binomial(n-1,n-k) = binomial(n-1,k-1) Juergen Will, Jan 04 2016
G.f.: (x^1 + x^2 + x^3 + ...)^k = (x/(1-x))^k. - Juergen Will, Jan 04 2016
From Tom Copeland, Nov 15 2016: (Start)
E.g.f.: 1 + x*[e^((x+1)t)-1]/(x+1).
This padded Pascal matrix with the odd columns negated is NpdP = M*S = S^(-1)*M^(-1) = S^(-1)*M, where M(n,k) = (-1)^n A130595(n,k), the inverse Pascal matrix with the odd rows negated, S is the summation matrix A000012, the lower triangular matrix with all elements unity, and S^(-1) = A167374, a finite difference matrix. NpdP is self-inverse, i.e., (M*S)^2 = the identity matrix, and has the e.g.f. 1 - x*[e^((1-x)t)-1]/(1-x).
M = NpdP*S^(-1) follows from the well-known recursion property of the Pascal matrix, implying NpdP = M*S.
The self-inverse property of -NpdP is implied by the self-inverse relation of its embedded signed Pascal submatrix M (cf. A130595). Also see A118800 for another proof.
Let P^(-1) be A130595, the inverse Pascal matrix. Then T = A200139*P^(-1) and T^(-1) = padded P^(-1) = P*A097808*P^(-1). (End)
The center (n>0) is T(2n+1,n+1) = A000984(n) = 2*A001700(n-1) = 2*A088218(n) = A126869(2n) = 2*A138364(2n-1). - Gus Wiseman, Jan 25 2022

Extensions

Corrected by Philippe Deléham, Oct 05 2005
New name using classical terminology by Peter Luschny, Feb 05 2019

A001791 a(n) = binomial coefficient C(2n, n-1).

Original entry on oeis.org

0, 1, 4, 15, 56, 210, 792, 3003, 11440, 43758, 167960, 646646, 2496144, 9657700, 37442160, 145422675, 565722720, 2203961430, 8597496600, 33578000610, 131282408400, 513791607420, 2012616400080, 7890371113950, 30957699535776, 121548660036300, 477551179875952
Offset: 0

Comments

Number of peaks at even level in all Dyck paths of semilength n+1. Example: a(2)=4 because UDUDUD, UDUU*DD, UU*DDUD, UU*DU*DD, UUUDDD, where U=(1,1), D=(1,-1) and the peaks at even level are shown by *. - Emeric Deutsch, Dec 05 2003
Also number of long ascents (i.e., ascents of length at least two) in all Dyck paths of semilength n+1. Example: a(2)=4 because in the five Dyck paths of semilength 3, namely UDUDUD, UD(UU)DD, (UU)DDUD, (UU)DUDD and (UUU)DDD, we have four long ascents (shown between parentheses). Here U=(1,1) and D=(1,-1). Also number of branch nodes (i.e., vertices of outdegree at least two) in all ordered trees with n+1 edges. - Emeric Deutsch, Feb 22 2004
Number of lattice paths from (0,0) to (n,n) with steps E=(1,0) and N=(0,1) which touch or cross the line x-y=1. Example: For n=2 these are the paths EENN, ENEN, ENNE and NEEN. - Herbert Kociemba, May 23 2004
Narayana transform (A001263) of [1, 3, 5, 7, 9, ...] = (1, 4, 15, 56, 210, ...). Row sums of triangles A136534 and A136536. - Gary W. Adamson, Jan 04 2008
Starting with offset 1 = the Catalan sequence starting (1, 2, 5, 14, ...) convolved with A000984: (1, 2, 6, 20, ...). - Gary W. Adamson, May 17 2009
Also number of peaks plus number of valleys in all Dyck n-paths. - David Scambler, Oct 08 2012
Apparently counts UDDUD in all Dyck paths of semilength n+2. - David Scambler, Apr 22 2013
Apparently the number of peaks strictly left of the midpoint in all Dyck paths of semilength n+1. - David Scambler, Apr 30 2013
For n>0, a(n) is the number of compositions of n into at most n parts if zeros are allowed as parts (so-called "weak" compositions). - L. Edson Jeffery, Jul 24 2014
Number of paths in the half-plane x >= 0, from (0,0) to (2n,2), and consisting of steps U=(1,1) and D=(1,-1). For example, for n=2, we have the 4 paths: UUUD, UUDU, UDUU, DUUU. - José Luis Ramírez Ramírez, Apr 19 2015
For n>1, 1/a(n) is the probability that when a stick is broken up at n points independently and uniformly chosen at random along its length any triple of pieces of the n+1 pieces can form a triangle. The corresponding probability for the existence of at least one triple is A339392(n)/A339393(n). - Amiram Eldar, Dec 04 2020
a(n) is the number of lattice paths of 2n steps taken from the step set {U=(1,1), D=(1,-1)} that start at the origin, never go below the x-axis, and end strictly above the x-axis; more succinctly, proper left factors of Dyck paths. For example, a(2)=4 counts UUUU, UUUD, UUDU, UDUU. - David Callan and Emeric Deutsch, Jan 25 2021
From Gus Wiseman, Jul 21 2021: (Start)
Also the number of integer compositions of 2n+1 with alternating sum -1, where the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. For example, the a(1) = 1 through a(3) = 15 compositions are:
(1,2) (2,3) (3,4)
(1,3,1) (1,4,2)
(1,1,1,2) (2,4,1)
(1,2,1,1) (1,1,2,3)
(1,2,2,2)
(1,3,2,1)
(2,1,1,3)
(2,2,1,2)
(2,3,1,1)
(1,1,1,3,1)
(1,2,1,2,1)
(1,3,1,1,1)
(1,1,1,1,1,2)
(1,1,1,2,1,1)
(1,2,1,1,1,1)
The following relate to these compositions.
- The unordered version is A000070.
- Allowing any negative alternating sum gives A000346.
- The opposite (positive 1) version is A000984.
- The version for reverse-alternating sum is also A001791 (this sequence).
- Taking alternating sum -2 instead of -1 gives A002054.
- The shifted version for alternating sum 0 is counted by A088218 and ranked by A344619.
- Ranked by A345910 (reverse: A345912).
Equivalently, a(n) counts binary numbers with 2n+1 digits and one more 0 than 1's. For example, the a(2) = 4 binary numbers are: 10001, 10010, 10100, 11000.
(End)
The diagonal of a square n X n matrix where cells of the first row are the nonnegative integers and cells of subsequent rows are sums of cells of the previous row up to and including n. - Torlach Rush, Apr 24 2024
For n>=1, a(n) is the independence number of the odd graph O_{n+1}. - Miquel A. Fiol, Jul 07 2024

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 828.
  • Cornelius Lanczos, Applied Analysis, Prentice-Hall, Englewood Cliffs, NJ, 1956, p. 517.
  • R. C. Mullin, E. Nemeth and P. J. Schellenberg, The enumeration of almost cubic maps, pp. 281-295 in Proceedings of the Louisiana Conference on Combinatorics, Graph Theory and Computer Science. Vol. 1, edited R. C. Mullin et al., 1970.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Diagonal 3 of triangle A100257.
First differences are in A076540.
A345197 counts compositions by length and alternating sum.

Programs

  • GAP
    List([0..30],n->Binomial(2*n,n-1)); # Muniru A Asiru, Aug 09 2018
  • Magma
    [Binomial(2*n, n-1): n in [0..30]]; // Vincenzo Librandi, Apr 20 2015
    
  • Mathematica
    Table[Binomial[2n,n-1],{n,0,30}] (* Harvey P. Dale, Jul 12 2012 *)
    CoefficientList[ Series[(1 - 2x - Sqrt[1 - 4x])/(2x*Sqrt[1 - 4x]), {x, 0, 26}], x] (* Robert G. Wilson v, Aug 10 2018 *)
  • Maxima
    A001791(n):=binomial(2*n,n-1)$
    makelist(A001791(n),n,0,30); /* Martin Ettl, Nov 05 2012 */
    
  • PARI
    a(n)=if(n<1,0,(2*n)!/(n+1)!/(n-1)!)
    

Formula

a(n) = n*A000108(n).
G.f.: x*(d/dx)c(x) where c(x) = Catalan g.f. - Wolfdieter Lang
Convolution of A001700 (central binomial of odd order) and A000108 (Catalan): a(n+1) = Sum_{k=0..n} C(k)*binomial(2*(n-k)+1, n-k), C(k): Catalan. - Wolfdieter Lang
E.g.f.: exp(2x) * I_1(2x), where I_1 is Bessel function. - Michael Somos, Sep 08 2002
a(n) = Sum_{k=0..n} C(n, k)*C(n, k+1). - Paul Barry, May 15 2003
a(n) = Sum_{i=1..n} binomial(i+n-1, n).
G.f.: (1-2x-sqrt(1-4x))/(2x*sqrt(1-4x)). - Emeric Deutsch, Dec 05 2003
a(n) = A092956/(n!). - Amarnath Murthy, Jun 16 2004
a(n) = binomial(2n,n) - A000108(n). - Paul Barry, Apr 21 2005
a(n) = (1/(2*Pi))*Integral_{x=0..4} (x^n*(x-2)/sqrt(x(4-x))) is the moment sequence representation. - Paul Barry, Jan 11 2007
Row sums of triangle A132812 starting (1, 4, 15, 56, 210, ...). - Gary W. Adamson, Sep 01 2007
Starting (1, 4, 15, 56, 210, ...) gives the binomial transform of A025566 starting (1, 3, 8, 22, 61, 171, ...). - Gary W. Adamson, Sep 01 2007
For n >= 1, a(2^n) = 2^(n+1)*A001795(2^(n-1)). - Vladimir Shevelev, Sep 05 2010
D-finite with recurrence: (n-1)*(n+1)*a(n) = 2*n*(2n-1)*a(n-1). - R. J. Mathar, Dec 17 2011
From Sergei N. Gladkovskii, Jul 07 2012: (Start)
G.f.: -1/(2*x) - G(0) where G(k) = 1 - 1/(2*x - 8*x^3*(2*k+1)/(4*x^2*(2*k+1)- (k+1)/G(k+1))); (continued fraction, 3rd kind, 3-step);
E.g.f.: BesselI(1,2*x)*exp(2*x) = x*G(0) where G(k) = 1 + 2*x*(4*k+3)/((2*k+1)*(2*k+3) - x*(2*k+1)*(2*k+3)*(4*k+5)/(x*(4*k+5) + 2*(k+1)*(k+2)/G(k+1))); (continued fraction, 3rd kind, 3-step).
(End)
G.f.: c(x)^3/(2-c(x)) where c(x) is the g.f. for A000108. - Cheyne Homberger, May 05 2014
G.f.: z*C(z)^2/(1-2*z*C(z)), where C(z) is the g.f. of Catalan numbers. - José Luis Ramírez Ramírez, Apr 19 2015
G.f.: x*2F1(3/2,2;3;4x). - R. J. Mathar, Aug 09 2015
a(n) = Sum_{i=1..n} binomial(2*i-2,i-1)*binomial(2*(n-i+1),n-i+2)/(n-i+1). - Vladimir Kruchinin, Sep 07 2015
L.g.f.: 1/(1 - x/(1 - x/(1 - x/(1 - x/(1 - x/(1 - ...)))))) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, May 10 2017
Sum_{n>=1} 1/a(n) = 1/3 + 5*Pi/(9*sqrt(3)). - Amiram Eldar, Dec 04 2020
Sum_{n>=1} (-1)^(n+1)/a(n) = 1/5 + 14*sqrt(5)*log(phi)/25, where log(phi) = A002390. - Amiram Eldar, Feb 20 2021
a(n) = Product_{i=1..(n - 1)} (((4*i + 6)*i + 2)/((i + 2)*i)), for n>=1. - Neven Sajko, Oct 10 2021
a(n) = 2^(2*n)*gamma(n + 1/2)/(sqrt(Pi)*gamma(n)*(n+1)) for n > 0, and a(0) = lim_{n->0} a(n). - Karol A. Penson, Apr 24 2025

A000346 a(n) = 2^(2*n+1) - binomial(2*n+1, n+1).

Original entry on oeis.org

1, 5, 22, 93, 386, 1586, 6476, 26333, 106762, 431910, 1744436, 7036530, 28354132, 114159428, 459312152, 1846943453, 7423131482, 29822170718, 119766321572, 480832549478, 1929894318332, 7744043540348, 31067656725032, 124613686513778, 499744650202436
Offset: 0

Keywords

Comments

Also a(n) = 2nd elementary symmetric function of binomial(n,0), binomial(n,1), ..., binomial(n,n).
Also a(n) = one half the sum of the heights, over all Dyck (n+2)-paths, of the vertices that are at even height and terminate an upstep. For example with n=1, these vertices are indicated by asterisks in the 5 Dyck 3-paths: UU*UDDD, UU*DU*DD, UDUU*DD, UDUDUD, UU*DDUD, yielding a(1)=(2+4+2+0+2)/2=5. - David Callan, Jul 14 2006
Hankel transform is (-1)^n*(2n+1); the Hankel transform of sum(k=0..n, C(2*n,k) ) - C(2n,n) is (-1)^n*n. - Paul Barry, Jan 21 2007
Row sums of the Riordan matrix (1/(1-4x),(1-sqrt(1-4x))/2) (A187926). - Emanuele Munarini, Mar 16 2011
From Gus Wiseman, Jul 19 2021: (Start)
For n > 0, a(n-1) is also the number of integer compositions of 2n with nonzero alternating sum, where the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. These compositions are ranked by A053754 /\ A345921. For example, the a(3-1) = 22 compositions of 6 are:
(6) (1,5) (1,1,4) (1,1,1,3) (1,1,1,1,2)
(2,4) (1,2,3) (1,1,3,1) (1,1,2,1,1)
(4,2) (1,4,1) (1,2,1,2) (2,1,1,1,1)
(5,1) (2,1,3) (1,3,1,1)
(2,2,2) (2,1,2,1)
(3,1,2) (3,1,1,1)
(3,2,1)
(4,1,1)
(End)

Examples

			G.f. = 1 + 5*x + 22*x^2 + 93*x^3 + 386*x^4 + 1586*x^5 + 6476*x^6 + ...
		

References

  • T. Myers and L. Shapiro, Some applications of the sequence 1, 5, 22, 93, 386, ... to Dyck paths and ordered trees, Congressus Numerant., 204 (2010), 93-104.
  • D. Phulara and L. W. Shapiro, Descendants in ordered trees with a marked vertex, Congressus Numerantium, 205 (2011), 121-128.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000108, A014137, A014318. A column of A058893. Subdiagonal of A053979.
Bisection of A058622 and (possibly) A007008.
Even bisection of A294175 (without the first two terms).
The following relate to compositions of 2n with alternating sum k.
- The k > 0 case is counted by A000302.
- The k <= 0 case is counted by A000302.
- The k != 0 case is counted by A000346 (this sequence).
- The k = 0 case is counted by A001700 or A088218.
- The k < 0 case is counted by A008549.
- The k >= 0 case is counted by A114121.
A011782 counts compositions.
A086543 counts partitions with nonzero alternating sum (bisection: A182616).
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A345197 counts compositions by length and alternating sum.

Programs

  • Magma
    [2^(2*n+1) - Binomial(2*n+1,n+1): n in [0..30]]; // Vincenzo Librandi, Jun 07 2011
  • Maple
    seq(2^(2*n+1)-binomial(2*n,n)*(2*n+1)/(n+1), n=0..12); # Emanuele Munarini, Mar 16 2011
  • Mathematica
    Table[2^(2n+1)-Binomial[2n,n](2n+1)/(n+1),{n,0,20}] (* Emanuele Munarini, Mar 16 2011 *)
    a[ n_] := If[ n<-4, 0, (4^(n + 1) - Binomial[2 n + 2, n + 1]) / 2]; (* Michael Somos, Jan 25 2014 *)
  • Maxima
    makelist(2^(2*n+1)-binomial(2*n,n)*(2*n+1)/(n+1),n,0,12); /* Emanuele Munarini, Mar 16 2011 */
    
  • PARI
    {a(n) = if( n<-4, 0, n++; (2^(2*n) - binomial(2*n, n)) / 2)}; /* Michael Somos, Jan 25 2014 */
    

Formula

G.f.: c(x)/(1-4x), c(x) = g.f. of Catalan numbers.
Convolution of Catalan numbers and powers of 4.
Also one half of convolution of central binomial coeffs. A000984(n), n=0, 1, 2, ... with shifted central binomial coeffs. A000984(n), n=1, 2, 3, ...
a(n) = A045621(2n+1) = (1/2)*A068551(n+1).
a(n) = Sum_{k=0..n} A000984(k)*A001700(n-k). - Philippe Deléham, Jan 22 2004
a(n) = Sum_{k=0..n+1} binomial(n+k, k-1)2^(n-k+1). - Paul Barry, Nov 13 2004
a(n) = Sum_{i=0..n} binomial(2n+2, i). See A008949. - Ed Catmur (ed(AT)catmur.co.uk), Dec 09 2006
a(n) = Sum_{k=0..n+1, C(2n+2,k)} - C(2n+2,n+1). - Paul Barry, Jan 21 2007
Logarithm g.f. log(1/(2-C(x)))=sum(n>0, a(n)/n*x^n), C(x)=(1-sqrt(1-4*x))/2x (A000108). - Vladimir Kruchinin, Aug 10 2010
D-finite with recurrence: (n+3) a(n+2) - 2(4n+9) a(n+1) + 8(2n+3) a(n) = 0. - Emanuele Munarini, Mar 16 2011
E.g.f.:exp(2*x)*(2*exp(2*x) - BesselI(0,2*x) - BesselI(1,2*x)).
This is the first derivative of exp(2*x)*(exp(2*x) - BesselI(0,2*x))/2. See the e.g.f. of A032443 (which has a plus sign) and the remarks given there. - Wolfdieter Lang, Jan 16 2012
a(n) = Sum_{0<=iMircea Merca, Apr 05 2012
A000346 = A004171 - A001700. See A032443 for the sum. - M. F. Hasler, Jan 02 2014
0 = a(n) * (256*a(n+1) - 224*a(n+2) + 40*a(n+3)) + a(n+1) * (-32*a(n+1) + 56*a(n+2) - 14*a(n+3)) + a(n+2) * (-2*a(n+2) + a(n+3)) if n>-5. - Michael Somos, Jan 25 2014
REVERT transform is [1,-5,28,-168,1056,...] = alternating signed version of A069731. - Michael Somos, Jan 25 2014
Convolution square is A038806. - Michael Somos, Jan 25 2014
BINOMIAL transform of A055217(n-1) is a(n-1). - Michael Somos, Jan 25 2014
(n+1) * a(n) = A033504(n). - Michael Somos, Jan 25 2014
Recurrence: (n+1)*a(n) = 512*(2*n-7)*a(n-5) + 256*(13-5*n)*a(n-4) + 64*(10*n-17)*a(n-3) + 32*(4-5*n)*a(n-2) + 2*(10*n+1)*a(n-1), n>=5. - Fung Lam, Mar 21 2014
Asymptotic approximation: a(n) ~ 2^(2n+1)*(1-1/sqrt(n*Pi)). - Fung Lam, Mar 21 2014
a(n) = Sum_{m = n+2..2*(n+1)} binomial(2*(n+1), m), n >= 0. - Wolfdieter Lang, May 22 2015
a(n) = A000302(n) + A008549(n). - Gus Wiseman, Jul 19 2021
a(n) = Sum_{j=1..n+1} Sum_{k=1..j} 2^(j-k)*binomial(n+k-1, n). - Fabio Visonà, May 04 2022
a(n) = (1/2)*(-1)^n*binomial(-(n+1), n+2)*hypergeom([1, 2*n + 3], [n + 3], 1/2). - Peter Luschny, Nov 29 2023

Extensions

Corrected by Christian G. Bower

A002054 Binomial coefficient C(2n+1, n-1).

Original entry on oeis.org

1, 5, 21, 84, 330, 1287, 5005, 19448, 75582, 293930, 1144066, 4457400, 17383860, 67863915, 265182525, 1037158320, 4059928950, 15905368710, 62359143990, 244662670200, 960566918220, 3773655750150, 14833897694226, 58343356817424, 229591913401900
Offset: 1

Keywords

Comments

a(n) = number of permutations in S_{n+2} containing exactly one 312 pattern. E.g., S_3 has a_1 = 1 permutations containing exactly one 312 pattern, and S_4 has a_2 = 5 permutations containing exactly one 312 pattern, namely 1423, 2413, 3124, 3142, and 4231. This comment is also true if 312 is replaced by any of 132, 213, or 231 (but not 123 or 321, for which see A003517). [Comment revised by N. J. A. Sloane, Nov 26 2022]
Number of valleys in all Dyck paths of semilength n+1. Example: a(2)=5 because UD*UD*UD, UD*UUDD, UUDD*UD, UUD*UDD, UUUDDD, where U=(1,1), D=(1,-1) and the valleys are shown by *. - Emeric Deutsch, Dec 05 2003
Number of UU's (double rises) in all Dyck paths of semilength n+1. Example: a(2)=5 because UDUDUD, UDU*UDD, U*UDDUD, U*UDUDD, U*U*UDDD, the double rises being shown by *. - Emeric Deutsch, Dec 05 2003
Number of peaks at level higher than one (high peaks) in all Dyck paths of semilength n+1. Example: a(2)=5 because UDUDUD, UDUU*DD, UU*DDUD, UU*DU*DD, UUU*DDD, the high peaks being shown by *. - Emeric Deutsch, Dec 05 2003
Number of diagonal dissections of a convex (n+3)-gon into n regions. Number of standard tableaux of shape (n,n,1) (see Stanley reference). - Emeric Deutsch, May 20 2004
Number of dissections of a convex (n+3)-gon by noncrossing diagonals into several regions, exactly n-1 of which are triangular. Example: a(2)=5 because the convex pentagon ABCDE is dissected by any of the diagonals AC, BD, CE, DA, EB into regions containing exactly 1 triangle. - Emeric Deutsch, May 31 2004
Number of jumps in all full binary trees with n+1 internal nodes. In the preorder traversal of a full binary tree, any transition from a node at a deeper level to a node on a strictly higher level is called a jump. - Emeric Deutsch, Jan 18 2007
a(n) is the total number of nonempty Dyck subpaths in all Dyck paths (A000108) of semilength n. For example, the Dyck path UUDUUDDD has Dyck subpaths stretching over positions 1-8 (the entire path), 2-3, 2-7, 4-7, 5-6 and so contributes 5 to a(4). - David Callan, Jul 25 2008
a(n+1) is the total number of ascents in the set of all n-permutations avoiding the pattern 132. For example, a(2) = 5 because there are 5 ascents in the set 123, 213, 231, 312, 321. - Cheyne Homberger, Oct 25 2013
Number of increasing tableaux of shape (n+1,n+1) with largest entry 2n+1. An increasing tableau is a semistandard tableau with strictly increasing rows and columns, and set of entries an initial segment of the positive integers. Example: a(2) = 5 counts the five tableaux (124)(235), (123)(245), (124)(345), (134)(245), (123)(245). - Oliver Pechenik, May 02 2014
a(n) is the number of noncrossing partitions of 2n+1 into n-1 blocks of size 2 and 1 block of size 3. - Oliver Pechenik, May 02 2014
Number of paths in the half-plane x>=0, from (0,0) to (2n+1,3), and consisting of steps U=(1,1) and D=(1,-1). For example, for n=2, we have the 5 paths: UUUUD, UUUDU, UUDUU, UDUUU, DUUUU. - José Luis Ramírez Ramírez, Apr 19 2015
From Gus Wiseman, Aug 20 2021: (Start)
Also the number of binary numbers with 2n+2 digits and with two more 0's than 1's. For example, the a(2) = 5 binary numbers are: 100001, 100010, 100100, 101000, 110000, with decimal values 33, 34, 36, 40, 48. Allowing first digit 0 gives A001791, ranked by A345910/A345912.
Also the number of integer compositions of 2n+2 with alternating sum -2, where the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. For example, the a(3) = 21 compositions are:
(35) (152) (1124) (11141) (111113)
(251) (1223) (12131) (111212)
(1322) (13121) (111311)
(1421) (14111) (121112)
(2114) (121211)
(2213) (131111)
(2312)
(2411)
The following pertain to these compositions:
- The unordered version is A344741.
- Ranked by A345924 (reverse: A345923).
- A345197 counts compositions by length and alternating sum.
- A345925 ranks compositions with alternating sum 2 (reverse: A345922).
(End)

Examples

			G.f. = x + 5*x^2 + 21*x^3 + 84*x^4 + 330*x^5 + 1287*x^6 + 5005*x^7 + ...
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 828.
  • George Grätzer, General Lattice Theory. Birkhauser, Basel, 1998, 2nd edition, p. 474, line -3.
  • A. P. Prudnikov, Yu. A. Brychkov and O.I. Marichev, "Integrals and Series", Volume 1: "Elementary Functions", Chapter 4: "Finite Sums", New York, Gordon and Breach Science Publishers, 1986-1992.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Diagonal 4 of triangle A100257. Also a diagonal of A033282.
Equals (1/2) A024483(n+2). Bisection of A037951 and A037955.
Cf. A001263.
Column k=1 of A263771.
Counts terms of A031445 with 2n+2 digits in binary.
Cf. binomial(2*n+m, n): A000984 (m = 0), A001700 (m = 1), A001791 (m = 2), A002694 (m = 4), A003516 (m = 5), A002696 (m = 6), A030053 - A030056, A004310 - A004318.

Programs

  • GAP
    List([1..25],n->Binomial(2*n+1,n-1)); # Muniru A Asiru, Aug 09 2018
    
  • Magma
    [Binomial(2*n+1, n-1): n in [1..30]]; // Vincenzo Librandi, Apr 20 2015
    
  • Maple
    with(combstruct): seq((count(Composition(2*n+2), size=n)), n=1..24); # Zerinvary Lajos, May 03 2007
  • Mathematica
    CoefficientList[Series[8/(((Sqrt[1-4x] +1)^3)*Sqrt[1-4x]), {x,0,22}], x] (* Robert G. Wilson v, Aug 08 2011 *)
    a[ n_]:= Binomial[2 n + 1, n - 1]; (* Michael Somos, Apr 25 2014 *)
  • PARI
    {a(n) = binomial( 2*n+1, n-1)};
    
  • Python
    from _future_ import division
    A002054_list, b = [], 1
    for n in range(1,10**3):
        A002054_list.append(b)
        b = b*(2*n+2)*(2*n+3)//(n*(n+3)) # Chai Wah Wu, Jan 26 2016
    
  • Sage
    [binomial(2*n+1, n-1) for n in (1..25)] # G. C. Greubel, Mar 22 2019

Formula

a(n) = Sum_{j=0..n-1} binomial(2*j, j) * binomial(2*n - 2*j, n-j-1)/(j+1). - Yong Kong (ykong(AT)curagen.com), Dec 26 2000
G.f.: z*C^4/(2-C), where C=[1-sqrt(1-4z)]/(2z) is the Catalan function. - Emeric Deutsch, Jul 05 2003
From Wolfdieter Lang, Jan 09 2004: (Start)
a(n) = binomial(2*n+1, n-1) = n*C(n+1)/2, C(n)=A000108(n) (Catalan).
G.f.: (1 - 2*x - (1-3*x)*c(x))/(x*(1-4*x)) with g.f. c(x) of A000108. (End)
G.f.: z*C(z)^3/(1-2*z*C(z)), where C(z) is the g.f. of Catalan numbers. - José Luis Ramírez Ramírez, Apr 19 2015
G.f.: 2F1(5/2, 2; 4; 4*x). - R. J. Mathar, Aug 09 2015
D-finite with recurrence: a(n+1) = a(n)*(2*n+3)*(2*n+2)/(n*(n+3)). - Chai Wah Wu, Jan 26 2016
From Ilya Gutkovskiy, Aug 30 2016: (Start)
E.g.f.: (BesselI(0,2*x) + (1 - 1/x)*BesselI(1,2*x))*exp(2*x).
a(n) ~ 2^(2*n+1)/sqrt(Pi*n). (End)
a(n) = (1/(n+1))*Sum_{i=0..n-1} (n+1-i)*binomial(2n+2,i), n >= 1. - Taras Goy, Aug 09 2018
G.f.: (x - 1 + (1 - 3*x)/sqrt(1 - 4*x))/(2*x^2). - Michael Somos, Jul 28 2021
From Amiram Eldar, Jan 24 2022: (Start)
Sum_{n>=1} 1/a(n) = 5/3 - 2*Pi/(9*sqrt(3)).
Sum_{n>=1} (-1)^(n+1)/a(n) = 52*log(phi)/(5*sqrt(5)) - 7/5, where phi is the golden ratio (A001622). (End)
a(n) = A001405(2*n+1) - A000108(n+1), n >= 1 (from Eremin link, page 7). - Gennady Eremin, Sep 05 2023
G.f.: x/(1 - 4*x)^2 * c(-x/(1 - 4*x))^3, where c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the g.f. of the Catalan numbers A000108. - Peter Bala, Feb 03 2024
From Peter Bala, Oct 13 2024: (Start)
a(n) = Integral_{x = 0..4} x^n * w(x) dx, where the weight function w(x) = 1/(2*Pi) * sqrt(x)*(x - 3)/sqrt(4 - x) (see Penson).
G.f. x*/sqrt(1 - 4*x) * c(x)^3. (End)

A027306 a(n) = 2^(n-1) + ((1 + (-1)^n)/4)*binomial(n, n/2).

Original entry on oeis.org

1, 1, 3, 4, 11, 16, 42, 64, 163, 256, 638, 1024, 2510, 4096, 9908, 16384, 39203, 65536, 155382, 262144, 616666, 1048576, 2449868, 4194304, 9740686, 16777216, 38754732, 67108864, 154276028, 268435456, 614429672, 1073741824, 2448023843
Offset: 0

Keywords

Comments

Inverse binomial transform of A027914. Hankel transform (see A001906 for definition) is {1, 2, 3, 4, ..., n, ...}. - Philippe Deléham, Jul 21 2005
Number of walks of length n on a line that starts at the origin and ends at or above 0. - Benjamin Phillabaum, Mar 05 2011
Number of binary integers (i.e., with a leading 1 bit) of length n+1 which have a majority of 1-bits. E.g., for n+1=4: (1011, 1101, 1110, 1111) a(3)=4. - Toby Gottfried, Dec 11 2011
Number of distinct symmetric staircase walks connecting opposite corners of a square grid of side n > 1. - Christian Barrientos, Nov 25 2018
From Gus Wiseman, Aug 20 2021: (Start)
Also the number of integer compositions of n + 1 with alternating sum > 0, where the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. These compositions are ranked by A345917. For example, the a(0) = 1 through a(4) = 11 compositions are:
(1) (2) (3) (4) (5)
(21) (31) (32)
(111) (112) (41)
(211) (113)
(122)
(212)
(221)
(311)
(1121)
(2111)
(11111)
The following relate to these compositions:
- The unordered version is A027193.
- The complement is counted by A058622.
- The reverse unordered version is A086543.
- The version for alternating sum >= 0 is A116406.
- The version for alternating sum < 0 is A294175.
- Ranked by A345917. (End)
The Gauss congruences a(n*p^k) == a(n^p^(k-1)) (mod p^k) hold for prime p and positive integers n and k. - Peter Bala, Jan 07 2022

Examples

			From _Gus Wiseman_, Aug 20 2021: (Start)
The a(0) = 1 through a(4) = 11 binary numbers with a majority of 1-bits (Gottfried's comment) are:
  1   11   101   1011   10011
           110   1101   10101
           111   1110   10110
                 1111   10111
                        11001
                        11010
                        11011
                        11100
                        11101
                        11110
                        11111
The version allowing an initial zero is A058622.
(End)
		

References

  • A. P. Prudnikov, Yu. A. Brychkov and O.I. Marichev, "Integrals and Series", Volume 1: "Elementary Functions", Chapter 4: "Finite Sums", New York, Gordon and Breach Science Publishers, 1986-1992, Eq. (4.2.1.6)

Crossrefs

a(n) = Sum{(k+1)T(n, m-k)}, 0<=k<=[ (n+1)/2 ], T given by A008315.
Column k=2 of A226873. - Alois P. Heinz, Jun 21 2013
The even bisection is A000302.
The odd bisection appears to be A032443.

Programs

  • GAP
    List([0..35],n->Sum([0..Int(n/2)],k->Binomial(n,k))); # Muniru A Asiru, Nov 27 2018
  • Haskell
    a027306 n = a008949 n (n `div` 2)  -- Reinhard Zumkeller, Nov 14 2014
    
  • Magma
    [2^(n-1)+(1+(-1)^n)/4*Binomial(n, n div 2): n in [0..40]]; // Vincenzo Librandi, Jun 19 2016
    
  • Maple
    a:= proc(n) add(binomial(n, j), j=0..n/2) end:
    seq(a(n), n=0..32); # Zerinvary Lajos, Mar 29 2009
  • Mathematica
    Table[Sum[Binomial[n, k], {k, 0, Floor[n/2]}], {n, 1, 35}]
    (* Second program: *)
    a[0] = a[1] = 1; a[2] = 3; a[n_] := a[n] = (2(n-1)(2a[n-2] + a[n-1]) - 8(n-2) a[n-3])/n; Array[a, 33, 0] (* Jean-François Alcover, Sep 04 2016 *)
  • PARI
    a(n)=if(n<0,0,(2^n+if(n%2,0,binomial(n, n/2)))/2)
    

Formula

a(n) = Sum_{k=0..floor(n/2)} binomial(n,k).
Odd terms are 2^(n-1). Also a(2n) - 2^(2n-1) is given by A001700. a(n) = 2^n + (n mod 2)*binomial(n, (n-1)/2).
E.g.f.: (exp(2x) + I_0(2x))/2.
O.g.f.: 2*x/(1-2*x)/(1+2*x-((1+2*x)*(1-2*x))^(1/2)). - Vladeta Jovovic, Apr 27 2003
a(n) = A008949(n, floor(n/2)); a(n) + a(n-1) = A248574(n), n > 0. - Reinhard Zumkeller, Nov 14 2014
From Peter Bala, Jul 21 2015: (Start)
a(n) = [x^n]( 2*x - 1/(1 - x) )^n.
O.g.f.: (1/2)*( 1/sqrt(1 - 4*x^2) + 1/(1 - 2*x) ).
Inverse binomial transform is (-1)^n*A246437(n).
exp( Sum_{n >= 1} a(n)*x^n/n ) = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 10*x^5 + ... is the o.g.f. for A001405. (End)
a(n) = Sum_{k=1..floor((n+1)/2)} binomial(n-1,(2n+1-(-1)^n)/4 -k). - Anthony Browne, Jun 18 2016
D-finite with recurrence: n*a(n) + 2*(-n+1)*a(n-1) + 4*(-n+1)*a(n-2) + 8*(n-2)*a(n-3) = 0. - R. J. Mathar, Aug 09 2017

Extensions

Better description from Robert G. Wilson v, Aug 30 2000 and from Yong Kong (ykong(AT)curagen.com), Dec 28 2000

A008549 Number of ways of choosing at most n-1 items from a set of size 2*n+1.

Original entry on oeis.org

0, 1, 6, 29, 130, 562, 2380, 9949, 41226, 169766, 695860, 2842226, 11576916, 47050564, 190876696, 773201629, 3128164186, 12642301534, 51046844836, 205954642534, 830382690556, 3345997029244, 13475470680616, 54244942336114, 218269673491780, 877940640368572
Offset: 0

Keywords

Comments

Area under Dyck excursions (paths ending in 0): a(n) is the sum of the areas under all Dyck excursions of length 2*n (nonnegative walks beginning and ending in 0 with jumps -1,+1).
Number of inversions in all 321-avoiding permutations of [n+1]. Example: a(2)=6 because the 321-avoiding permutations of [3], namely 123,132,312,213,231, have 0, 1, 2, 1, 2 inversions, respectively. - Emeric Deutsch, Jul 28 2003
Convolution of A001791 and A000984. - Paul Barry, Feb 16 2005
a(n) = total semilength of "longest Dyck subpath" starting at an upstep U taken over all upsteps in all Dyck paths of semilength n. - David Callan, Jul 25 2008
[1,6,29,130,562,2380,...] is convolution of A001700 with itself. - Philippe Deléham, May 19 2009
From Ran Pan, Feb 04 2016: (Start)
a(n) is the total number of times that all the North-East lattice paths from (0,0) to (n+1,n+1) bounce off the diagonal y = x to the right. This is related to paired pattern P_2 in Pan and Remmel's link and more details can be found in Section 3.2 in the link.
a(n) is the total number of times that all the North-East lattice paths from (0,0) to (n+1,n+1) horizontally cross the diagonal y = x. This is related to paired pattern P_3 in Pan and Remmel's link and more details can be found in Section 3.3 in the link.
2*a(n) is the total number of times that all the North-East lattice paths from (0,0) to (n+1,n+1) bounce off the diagonal y = x. This is related to paired pattern P_2 and P_4 in Pan and Remmel's link and more details can be found in Section 4.2 in the link.
2*a(n) is the total number of times that all the North-East lattice paths from (0,0) to (n+1,n+1) cross the diagonal y = x. This is related to paired pattern P_3 and P_4 in Pan and Remmel's link and more details can be found in Section 4.3 in the link. (End)
From Gus Wiseman, Jul 17 2021: (Start)
Also the number of integer compositions of 2*(n+1) with alternating sum < 0, where the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. For example, the a(3) = 29 compositions of 8 are:
(1,7) (1,5,2) (1,1,1,5) (1,1,1,4,1) (1,1,1,1,1,3)
(2,6) (1,6,1) (1,1,2,4) (1,2,1,3,1) (1,1,1,2,1,2)
(3,5) (2,5,1) (1,2,1,4) (1,3,1,2,1) (1,1,1,3,1,1)
(1,2,2,3) (1,4,1,1,1) (1,2,1,1,1,2)
(1,3,1,3) (1,2,1,2,1,1)
(1,3,2,2) (1,3,1,1,1,1)
(1,4,1,2)
(1,4,2,1)
(1,5,1,1)
(2,1,1,4)
(2,2,1,3)
(2,3,1,2)
(2,4,1,1)
Also the number of integer compositions of 2*(n+1) with reverse-alternating sum < 0. For a bijection, keep the odd-length compositions and reverse the even-length ones.
Also the number of 2*(n+1)-digit binary numbers with more 0's than 1's. For example, the a(2) = 6 binary numbers are: 100000, 100001, 100010, 100100, 101000, 110000; or in decimal: 32, 33, 34, 36, 40, 48.
(End)

Examples

			a(2) = 6 because there are 6 ways to choose at most 1 item from a set of size 5: You can choose the empty set, or you can choose any of the five one-element sets.
G.f. = x + 6*x^2 + 29*x^3 + 130*x^4 + 562*x^5 + 2380*x^6 + 9949*x^7 + ...
		

References

  • D. Phulara and L. W. Shapiro, Descendants in ordered trees with a marked vertex, Congressus Numerantium, 205 (2011), 121-128.

Crossrefs

Odd bisection of A294175 (even is A000346).
For integer compositions of 2*(n+1) with alternating sum k < 0 we have:
- The opposite (k > 0) version is A000302.
- The weak (k <= 0) version is (also) A000302.
- The k = 0 version is A001700 or A088218.
- The reverse-alternating version is also A008549 (this sequence).
- These compositions are ranked by A053754 /\ A345919.
- The complement (k >= 0) is counted by A114121.
- The case of reversed integer partitions is A344743(n+1).
A011782 counts compositions.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A316524 gives the alternating sum of prime indices (reverse: A344616).
A344610 counts partitions by sum and positive reverse-alternating sum.
A345197 counts compositions by length and alternating sum.

Programs

  • Magma
    [4^n-Binomial(2*n+1, n): n in [0..30]]; // Vincenzo Librandi, Feb 04 2016
    
  • Maple
    A008549:=n->4^n-binomial(2*n+1,n): seq(A008549(n), n=0..30);
  • Mathematica
    Table[4^n-Binomial[2n+1,n],{n,0,30}] (* Harvey P. Dale, May 11 2011 *)
    a[ n_] := If[ n<-4, 0, 4^n - Binomial[2 n + 2, n + 1] / 2] (* Michael Somos, Jan 25 2014 *)
  • PARI
    {a(n)=if(n<0, 0, 4^n - binomial(2*n+1, n))} /* Michael Somos Oct 31 2006 */
    
  • PARI
    {a(n) = if( n<-4, 0, n++; (4^n / 2 - binomial(2*n, n)) / 2)} /* Michael Somos, Jan 25 2014 */
    
  • Python
    import math
    def C(n,r):
        f=math.factorial
        return f(n)/f(r)/f(n-r)
    def A008549(n):
        return int((4**n)-C(2*n+1,n)) # Indranil Ghosh, Feb 18 2017

Formula

a(n) = 4^n - C(2*n+1, n).
a(n) = Sum_{k=1..n} Catalan(k)*4^(n-k): convolution of Catalan numbers and powers of 4.
G.f.: x*c(x)^2/(1 - 4*x), c(x) = g.f. of Catalan numbers. - Wolfdieter Lang
Note Sum_{k=0..2*n+1} binomial(2*n+1, k) = 2^(2n+1). Therefore, by the symmetry of Pascal's triangle, Sum_{k=0..n} binomial(2*n+1, k) = 2^(2*n) = 4^n. This explains why the following two expressions for a(n) are equal: Sum_{k=0..n-1} binomial(2*n+1, k) = 4^n - binomial(2*n+1, n). - Dan Velleman
G.f.: (2*x^2 - 1 + sqrt(1 - 4*x^2))/(2*(1 + 2*x)*(2*x - 1)*x^3).
a(n) = Sum_{k=0..n} C(2*k, k)*C(2*(n-k), n-k-1). - Paul Barry, Feb 16 2005
Second binomial transform of 2^n - C(n, floor(n/2)) = A045621(n). - Paul Barry, Jan 13 2006
a(n) = Sum_{0 < i <= k < n} binomial(n, k+i)*binomial(n, k-i). - Mircea Merca, Apr 05 2012
D-finite with recurrence (n+1)*a(n) + 2*(-4*n-1)*a(n-1) + 8*(2*n-1)*a(n-2) = 0. - R. J. Mathar, Dec 03 2012
0 = a(n) * (256*a(n+1) - 224*a(n+2) + 40*a(n+3)) + a(n+1) * (-32*a(n+1) + 56*a(n+2) - 14*a(n+3)) + a(n+2) * (-2*a(n+2) + a(n+3)) if n > -5. - Michael Somos, Jan 25 2014
Convolution square is A045894. - Michael Somos, Jan 25 2014
HANKEL transform is [0, -1, 2, -3, 4, -5, ...]. - Michael Somos, Jan 25 2014
BINOMIAL transform of [0, 0, 1, 3, 11, 35,...] (A109196) is [0, 0, 1, 6, 29, 130, ...]. - Michael Somos, Jan 25 2014
(n+1) * a(n) = A153338(n+1). - Michael Somos, Jan 25 2014
a(n) = Sum_{m = n+2..2*n+1} binomial(2*n+1,m), n >= 0. - Wolfdieter Lang, May 22 2015
E.g.f.: (exp(2*x) - BesselI(0,2*x) - BesselI(1,2*x))*exp(2*x). - Ilya Gutkovskiy, Aug 30 2016

Extensions

Better description from Dan Velleman (djvelleman(AT)amherst.edu), Dec 01 2000
Showing 1-10 of 48 results. Next