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
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
G.f. = 1 + 5*x + 22*x^2 + 93*x^3 + 386*x^4 + 1586*x^5 + 6476*x^6 + ...
- 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).
- Vincenzo Librandi, Table of n, a(n) for n = 0..500
- R. Bacher, On generating series of complementary plane trees arXiv:math/0409050 [math.CO], 2004.
- Vijay Balasubramanian, Javier M. Magan, and Qingyue Wu, A Tale of Two Hungarians: Tridiagonalizing Random Matrices, arXiv:2208.08452 [hep-th], 2022.
- Paul Barry, On a Central Transform of Integer Sequences, arXiv:2004.04577 [math.CO], 2020.
- E. A. Bender, E. R. Canfield and R. W. Robinson, The enumeration of maps on the torus and the projective plane, Canad. Math. Bull., 31 (1988), 257-271; see p. 270.
- D. E. Davenport, L. K. Pudwell, L. W. Shapiro and L. C. Woodson, The Boundary of Ordered Trees, 2014.
- P. Flajolet and R. Sedgewick, Analytic Combinatorics, 2009; see page 185
- R. K. Guy, Letter to N. J. A. Sloane
- Toufik Mansour and José L. Ramirez, Enumerations of polyominoes determined by Fuss-Catalan words, Australas. J. Combin. 81 (3) (2021) 447-457, table 1.
- Mircea Merca, A Special Case of the Generalized Girard-Waring Formula, J. Integer Sequences, Vol. 15 (2012), Article 12.5.7. - From _N. J. A. Sloane_, Nov 25 2012
- D. Merlini, R. Sprugnoli and M. C. Verri, Waiting patterns for a printer, FUN with algorithm'01, Isola d'Elba, 2001.
- D. Merlini, R. Sprugnoli and M. C. Verri, The tennis ball problem, J. Combin. Theory, A 99 (2002), 307-344 (A_n for s=2).
- Vera Posch, Correlators in Matrix Models, Master Thesis, Uppsala Univ. (Sweden 2023). See p. 44.
- John Riordan, Letter to N. J. A. Sloane, Sep 26 1980 with notes on the 1973 Handbook of Integer Sequences. Note that the sequences are identified by their N-numbers, not their A-numbers.
- W. T. Tutte, On the enumeration of planar maps. Bull. Amer. Math. Soc. 74 1968 64-74.
- T. R. S. Walsh and A. B. Lehman, Counting rooted maps by genus, J. Comb. Thy B13 (1972), 122-141 and 192-218 (eq. 5, b=1).
- N. J. A. Sloane, Notes
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
A008549.
- The k >= 0 case is counted by
A114121.
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.
Cf.
A000070,
A001791,
A007318,
A025047,
A027306,
A032443,
A053754,
A120452,
A163493,
A239830,
A344611,
A345921.
-
[2^(2*n+1) - Binomial(2*n+1,n+1): n in [0..30]]; // Vincenzo Librandi, Jun 07 2011
-
seq(2^(2*n+1)-binomial(2*n,n)*(2*n+1)/(n+1), n=0..12); # Emanuele Munarini, Mar 16 2011
-
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 *)
-
makelist(2^(2*n+1)-binomial(2*n,n)*(2*n+1)/(n+1),n,0,12); /* Emanuele Munarini, Mar 16 2011 */
-
{a(n) = if( n<-4, 0, n++; (2^(2*n) - binomial(2*n, n)) / 2)}; /* Michael Somos, Jan 25 2014 */
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
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 + ...
- D. Phulara and L. W. Shapiro, Descendants in ordered trees with a marked vertex, Congressus Numerantium, 205 (2011), 121-128.
- Indranil Ghosh, Table of n, a(n) for n = 0..1500 (terms 0..200 from T. D. Noe)
- José Agapito, Ângela Mestre, Maria M. Torres, and Pasquale Petrullo, On One-Parameter Catalan Arrays, Journal of Integer Sequences, 18 (2015), Article 15.5.1.
- Octavio Arizmendi, Daniel Perales, and Josue Vazquez-Becerra, Finite Free Convolution: Infinitesimal Distributions, arXiv:c [math.PR], 2025. See p. 34.
- Jean Christophe Aval, Adrien Boussicault, Patxi Laborde-Zubieta, and Mathias Pétréolle, Generating series of Periodic Parallelogram polyominoes, arXiv:1612.03759, 2016.
- Roland Bacher, On generating series of complementary plane trees, arXiv:math/0409050 [math.CO], 2004.
- Vijay Balasubramanian, Javier M. Magan, and Qingyue Wu, A Tale of Two Hungarians: Tridiagonalizing Random Matrices, arXiv:2208.08452 [hep-th], 2022.
- Cyril Banderier, Analytic combinatorics of random walks and planar maps, Ph. D. Thesis, 2001. [Broken link]
- Adrien Boussicault and P. Laborde-Zubieta, Periodic Parallelogram Polyominoes, arXiv preprint arXiv:1611.03766 [math.CO], 2016.
- AJ Bu, Explicit Generating Functions for the Sum of the Areas Under Dyck and Motzkin Paths (and for Their Powers), arXiv:2310.17026 [math.CO], 2023.
- AJ Bu and Doron Zeilberger, Using Symbolic Computation to Explore Generalized Dyck Paths and Their Areas, arXiv:2305.09030 [math.CO], 2023.
- Alexander Burstein and Sergi Elizalde, Total occurrence statistics on restricted permutations, arXiv:1305.3177 [math.CO], 2013.
- Robin Chapman, Moments of Dyck paths, Discrete Math., 204 (1999), 113-117.
- Nicolle González, Pamela E. Harris, Gordon Rojas Kirby, Mariana Smit Vega Garcia, and Bridget Eileen Tenner, Pinnacle sets of signed permutations, arXiv:2301.02628 [math.CO], 2023.
- Guo-Niu Han, Enumeration of Standard Puzzles, 2011. [Cached copy]
- Guo-Niu Han, Enumeration of Standard Puzzles, arXiv:2006.14070 [math.CO], 2020.
- Milan Janjić, Pascal Matrices and Restricted Words, J. Int. Seq., Vol. 21 (2018), Article 18.5.2.
- Niklas G. Johansson, Efficient Simulation of the Deutsch-Jozsa Algorithm, Master's Project, Department of Electrical Engineering & Department of Physics, Chemistry and Biology, Linkoping University, April, 2015.
- Miles Jones, Sergey Kitaev, and Jeffrey Remmel, Frame patterns in n-cycles, arXiv preprint arXiv:1311.3332 [math.CO], 2013.
- James A. Mingo and Josue Vazquez-Becerra, The Asymptotic Infinitesimal Distribution of a Real Wishart Random Matrix, arXiv:2112.15231 [math.PR], 2021.
- Henri Mühle, Symmetric Chain Decompositions and the Strong Sperner Property for Noncrossing Partition Lattices, arXiv:1509.06942v1 [math.CO], 2015.
- Ran Pan and Jeffrey B. Remmel, Paired patterns in lattice paths, arXiv:1601.07988 [math.CO], 2016.
- Elisa Pergola, Two bijections for the area of Dyck paths, Discrete Math., 241 (2001), 435-447.
- Wen-jin Woan, Area of Catalan Paths, Discrete Math., 226 (2001), 439-444.
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 reverse-alternating version is also
A008549 (this sequence).
- The complement (k >= 0) is counted by
A114121.
- The case of reversed integer partitions is
A344743(n+1).
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.
Cf.
A000070,
A001791,
A007318,
A025047,
A027306,
A032443,
A058622,
A120452,
A163493,
A239830,
A344611.
-
[4^n-Binomial(2*n+1, n): n in [0..30]]; // Vincenzo Librandi, Feb 04 2016
-
A008549:=n->4^n-binomial(2*n+1,n): seq(A008549(n), n=0..30);
-
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 *)
-
{a(n)=if(n<0, 0, 4^n - binomial(2*n+1, n))} /* Michael Somos Oct 31 2006 */
-
{a(n) = if( n<-4, 0, n++; (4^n / 2 - binomial(2*n, n)) / 2)} /* Michael Somos, Jan 25 2014 */
-
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
Better description from Dan Velleman (djvelleman(AT)amherst.edu), Dec 01 2000
A116406
Expansion of ((1 + x - 2x^2) + (1+x)*sqrt(1-4x^2))/(2(1-4x^2)).
Original entry on oeis.org
1, 1, 2, 3, 7, 11, 26, 42, 99, 163, 382, 638, 1486, 2510, 5812, 9908, 22819, 39203, 89846, 155382, 354522, 616666, 1401292, 2449868, 5546382, 9740686, 21977516, 38754732, 87167164, 154276028, 345994216, 614429672, 1374282019, 2448023843
Offset: 0
The alternating sum > 0 case appears to be
A027306.
The alternating sum <= 0 version is
A058622.
The alternating sum < 0 version is
A294175.
The restriction to reversed partitions is
A344607.
A103919 counts partitions by sum and alternating sum (reverse:
A344612).
A124754 gives the alternating sum of standard compositions.
A344610 counts partitions by sum and positive reverse-alternating sum.
A344616 lists the alternating sums of partitions by Heinz number.
Cf.
A000041,
A000070,
A000097,
A003242,
A006330,
A028260,
A058696,
A119899,
A239830,
A344605,
A344611,
A344650,
A344739.
-
CoefficientList[Series[((1+x-2x^2)+(1+x)Sqrt[1-4x^2])/(2(1-4x^2)),{x,0,40}],x] (* Harvey P. Dale, Aug 16 2012 *)
ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],ats[#]>=0&]],{n,0,15}] (* Gus Wiseman, Jun 20 2021 *)
A058622
a(n) = 2^(n-1) - ((1+(-1)^n)/4)*binomial(n, n/2).
Original entry on oeis.org
0, 1, 1, 4, 5, 16, 22, 64, 93, 256, 386, 1024, 1586, 4096, 6476, 16384, 26333, 65536, 106762, 262144, 431910, 1048576, 1744436, 4194304, 7036530, 16777216, 28354132, 67108864, 114159428, 268435456, 459312152, 1073741824, 1846943453
Offset: 0
Yong Kong (ykong(AT)curagen.com), Dec 29 2000
G.f. = x + x^2 + 4*x^3 + 5*x^4 + 16*x^5 + 22*x^6 + 64*x^7 + 93*x^8 + ...
From _Gus Wiseman_, Jul 19 2021: (Start)
The a(1) = 1 through a(5) = 16 compositions with nonzero alternating sum:
(1) (2) (3) (4) (5)
(1,2) (1,3) (1,4)
(2,1) (3,1) (2,3)
(1,1,1) (1,1,2) (3,2)
(2,1,1) (4,1)
(1,1,3)
(1,2,2)
(1,3,1)
(2,1,2)
(2,2,1)
(3,1,1)
(1,1,1,2)
(1,1,2,1)
(1,2,1,1)
(2,1,1,1)
(1,1,1,1,1)
(End)
- 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.7)
The following relate to compositions with nonzero alternating sum:
- The version for alternating sum > 0 is
A027306.
- The version for alternating sum < 0 is
A294175.
- These compositions are ranked by
A345921.
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.
Compositions of n, 2n, or 2n+1 with alternating/reverse-alternating sum k:
Cf.
A000070,
A000097,
A007318,
A008549,
A034871,
A114121,
A120452,
A163493,
A210736,
A239830,
A344611.
-
[(2^n -(1+(-1)^n)*Binomial(n, Floor(n/2))/2)/2: n in [0..40]]; // G. C. Greubel, Aug 08 2022
-
Table[Sum[Binomial[n, Floor[n/2 + i]], {i, 1, n}], {n, 0, 32}] (* Geoffrey Critzer, Jul 16 2009 *)
a[n_] := If[n < 0, 0, (2^n - Boole[EvenQ @ n] Binomial[n, Quotient[n, 2]])/2]; (* Michael Somos, Nov 22 2014 *)
a[n_] := If[n < 0, 0, n! SeriesCoefficient[(Exp[2 x] - BesselI[0, 2 x])/2, {x, 0, n}]]; (* Michael Somos, Nov 22 2014 *)
Table[2^(n - 1) - (1 + (-1)^n) Binomial[n, n/2]/4, {n, 0, 40}] (* Eric W. Weisstein, Mar 21 2018 *)
CoefficientList[Series[2 x/((1-2x)(1 + 2x + Sqrt[(1+2x)(1-2x)])), {x, 0, 40}], x] (* Eric W. Weisstein, Mar 21 2018 *)
ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],ats[#]!=0&]],{n,0,15}] (* Gus Wiseman, Jul 19 2021 *)
-
a(n) = 2^(n-1) - ((1+(-1)^n)/4)*binomial(n, n\2); \\ Michel Marcus, Dec 30 2015
-
my(x='x+O('x^100)); concat(0, Vec(2*x/((1-2*x)*(1+2*x+((1+2*x)*(1-2*x))^(1/2))))) \\ Altug Alkan, Dec 30 2015
-
from math import comb
def A058622(n): return (1<>1)>>1) if n else 0 # Chai Wah Wu, Aug 25 2025
-
[(2^n - binomial(n, n//2)*((n+1)%2))/2 for n in (0..40)] # G. C. Greubel, Aug 08 2022
A345197
Concatenation of square matrices A(n), each read by rows, where A(n)(k,i) is the number of 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.
Original entry on oeis.org
1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 2, 3, 0, 0, 2, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 2, 3, 4, 0, 0, 3, 4, 3, 0, 0, 0, 0, 2, 3, 0, 0, 0, 0, 1, 0, 0, 0
Offset: 0
The matrices for n = 1..7:
1 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1
1 0 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0
0 1 0 0 1 2 0 0 1 2 3 0 0 1 2 3 4 0 0 1 2 3 4 5 0
0 1 0 0 0 2 2 0 0 0 3 4 3 0 0 0 4 6 6 4 0 0
0 0 1 0 0 0 0 2 3 0 0 0 0 3 6 6 0 0
0 0 1 0 0 0 0 0 3 3 0 0 0
0 0 0 1 0 0 0
Matrix n = 5 counts the following compositions:
i=-3: i=-1: i=1: i=3: i=5:
-----------------------------------------------------------------
k=1: | 0 0 0 0 (5)
k=2: | (14) (23) (32) (41) 0
k=3: | 0 (131) (221)(122) (311)(113)(212) 0
k=4: | 0 (1211)(1112) (2111)(1121) 0 0
k=5: | 0 0 (11111) 0 0
The number of nonzero terms in each matrix appears to be
A000096.
The number of zeros in each matrix appears to be
A000124.
Row sums and column sums both appear to be
A007318 (Pascal's triangle).
Antidiagonal sums appear to be
A163493.
The reverse-alternating version is also
A345197 (this sequence).
A000041 counts partitions of 2n with alternating sum 0, ranked by
A000290.
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.
A344611 counts partitions of 2n with reverse-alternating sum >= 0.
Compositions of n, 2n, or 2n+1 with alternating/reverse-alternating sum k:
Cf.
A000070,
A000097,
A000346,
A007318,
A008549,
A025047,
A032443,
A034871,
A114121,
A120452,
A238279,
A239830,
A344604.
-
ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[#]==k&&ats[#]==i&]],{n,0,6},{k,1,n},{i,-n+2,n,2}]
Comments