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
A001250
Number of alternating permutations of order n.
Original entry on oeis.org
1, 1, 2, 4, 10, 32, 122, 544, 2770, 15872, 101042, 707584, 5405530, 44736512, 398721962, 3807514624, 38783024290, 419730685952, 4809759350882, 58177770225664, 740742376475050, 9902996106248192, 138697748786275802, 2030847773013704704, 31029068327114173810
Offset: 0
1 + x + 2*x^2 + 4*x^3 + 10*x^4 + 32*x^5 + 122*x^6 + 544*x^7 + 2770*x^8 + ...
From _Gus Wiseman_, Jun 21 2021: (Start)
The a(0) = 1 through a(4) = 10 permutations:
() (1) (1,2) (1,3,2) (1,3,2,4)
(2,1) (2,1,3) (1,4,2,3)
(2,3,1) (2,1,4,3)
(3,1,2) (2,3,1,4)
(2,4,1,3)
(3,1,4,2)
(3,2,4,1)
(3,4,1,2)
(4,1,3,2)
(4,2,3,1)
(End)
- L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 261.
- F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 262.
- 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).
- Alois P. Heinz, Table of n, a(n) for n = 0..500 (terms n=1..100 from Max Alekseyev)
- Max A. Alekseyev, On the number of permutations with bounded run lengths, arXiv:1205.4581 [math.CO], 2012-2013.
- Désiré André, Sur les permutations alternées, J. Math. Pur. Appl., 7 (1881), 167-184.
- Désiré André, Étude sur les maxima, minima et séquences des permutations, Ann. Sci. Ecole Norm. Sup., 3, no. 1 (1884), 121-135.
- Désiré André, Mémoire sur les permutations quasi-alternées, Journal de mathématiques pures et appliquées 5e série, tome 1 (1895), 315-350.
- Désiré André, Mémoire sur les séquences des permutations circulaires, Bulletin de la S. M. F., tome 23 (1895), pp. 122-184.
- Stefano Barbero, Umberto Cerruti, and Nadir Murru, Some combinatorial properties of the Hurwitz series ring arXiv:1710.05665 [math.NT], 2017.
- D. Berry, J. Broom, D. Dixon, and A. Flaherty, Umbral Calculus and the Boustrophedon Transform, 2013.
- C. K. Cook, M. R. Bacon, and R. A. Hillman, Higher-order Boustrophedon transforms for certain well-known sequences, Fib. Q., 55(3) (2017), 201-208.
- C. Davis, Problem 4755, Amer. Math. Monthly, 64 (1957) 596; solution by W. J. Blundon, 65 (1958), 533-534.
- Chandler Davis, Problem 4755: A Permutation Problem, Amer. Math. Monthly, 64 (1957) 596; solution by W. J. Blundon, 65 (1958), 533-534. [Denoted by P_n in solution.] [Annotated scanned copy]
- S. Kitaev, Multi-avoidance of generalized patterns, Discrete Math., 260 (2003), 89-100. (See p. 100.)
- S. T. Thompson, Problem E754: Skew Ordered Sequences, Amer. Math. Monthly, 54 (1947), 416-417. [Annotated scanned copy]
- Eric Weisstein's World of Mathematics, Alternating Permutation
The version for permutations of prime indices is
A345164.
The version for patterns is
A345194.
A049774 counts permutations avoiding adjacent (1,2,3).
A344614 counts compositions avoiding adjacent (1,2,3) and (3,2,1).
A344615 counts compositions avoiding the weak adjacent pattern (1,2,3).
A344654 counts partitions without a wiggly permutation, ranked by
A344653.
A345170 counts partitions with a wiggly permutation, ranked by
A345172.
Cf.
A000041,
A003242,
A032020,
A056986,
A261962,
A325534,
A325535,
A335452,
A344652,
A344740,
A345165.
-
a001250 n = if n == 1 then 1 else 2 * a000111 n
-- Reinhard Zumkeller, Sep 17 2014
-
# With Eulerian polynomials:
A := (n, x) -> `if`(n<2, 1/2/(1+I)^(1-n), add(add((-1)^j*binomial(n+1, j)*(m+1-j)^n, j=0..m)*x^m, m=0..n-1)):
A001250 := n -> 2*(I-1)^(1-n)*exp(I*(n-1)*Pi/2)*A(n,I);
seq(A001250(i), i=0..22); # Peter Luschny, May 27 2012
# second Maple program:
b:= proc(u, o) option remember;
`if`(u+o=0, 1, add(b(o-1+j, u-j), j=1..u))
end:
a:= n-> `if`(n<2, 1, 2)*b(n, 0):
seq(a(n), n=0..30); # Alois P. Heinz, Nov 29 2015
-
a[n_] := 4*Abs[PolyLog[-n, I]]; a[0] = a[1] = 1; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jan 09 2016, after M. F. Hasler *)
Table[Length[Select[Permutations[Range[n]],And@@(!(OrderedQ[#]||OrderedQ[Reverse[#]])&/@Partition[#,3,1])&]],{n,8}] (* Gus Wiseman, Jun 21 2021 *)
a[0]:=1; a[1]:=1; a[n_]:=a[n]=1/(n (n-1)) Sum[a[n-1-k] a[k] k, {k,1, n-1}]; Join[{a[0], a[1]}, Map[2 #! a[#]&, Range[2,24]]] (* Oliver Seipel, May 27 2024 *)
-
{a(n) = local(v=[1], t); if( n<0, 0, for( k=2, n+3, t=0; v = vector( k, i, if( i>1, t += v[k+1 - i]))); v[3])} /* Michael Somos, Feb 03 2004 */
-
{a(n) = if( n<0, 0, n! * polcoeff( (tan(x + x * O(x^n)) + 1 / cos(x + x * O(x^n)))^2, n))} /* Michael Somos, Feb 05 2011 */
-
A001250(n)=sum(m=0,n\2,my(k);(-1)^m*sum(j=0,k=n+1-2*m,binomial(k,j)*(-1)^j*(k-2*j)^(n+1))/k>>k)*2-(n==1) \\ M. F. Hasler, May 19 2012
-
A001250(n)=4*abs(polylog(-n,I))-(n==1) \\ M. F. Hasler, May 20 2012
-
my(x='x+O('x^66), egf=1+2*(tan(x)+1/cos(x))-2-x); Vec(serlaplace(egf)) /* Joerg Arndt, May 28 2012 */
-
from itertools import accumulate, islice
def A001250_gen(): # generator of terms
yield from (1,1)
blist = (0,2)
while True:
yield (blist := tuple(accumulate(reversed(blist),initial=0)))[-1]
A001250_list = list(islice(A001250_gen(),40)) # Chai Wah Wu, Jun 09-11 2022
-
from sympy import bernoulli, euler
def A001250(n): return 1 if n<2 else abs(((1<Chai Wah Wu, Nov 13 2024
-
# Algorithm of L. Seidel (1877)
def A001250_list(n) :
R = [1]; A = {-1:0, 0:2}; k = 0; e = 1
for i in (0..n) :
Am = 0; A[k + e] = 0; e = -e
for j in (0..i) : Am += A[k]; A[k] = Am; k += e
if i > 1 : R.append(A[-i//2] if i%2 == 0 else A[i//2])
return R
A001250_list(22) # Peter Luschny, Mar 31 2012
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 */
A345167
Numbers k such that the k-th composition in standard order is alternating.
Original entry on oeis.org
0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 16, 17, 18, 20, 22, 24, 25, 32, 33, 34, 38, 40, 41, 44, 45, 48, 49, 50, 54, 64, 65, 66, 68, 70, 72, 76, 77, 80, 81, 82, 88, 89, 96, 97, 98, 102, 108, 109, 128, 129, 130, 132, 134, 140, 141, 144, 145, 148, 152, 153, 160, 161, 162
Offset: 1
The terms together with their binary indices begin:
1: (1) 25: (1,3,1) 66: (5,2)
2: (2) 32: (6) 68: (4,3)
4: (3) 33: (5,1) 70: (4,1,2)
5: (2,1) 34: (4,2) 72: (3,4)
6: (1,2) 38: (3,1,2) 76: (3,1,3)
8: (4) 40: (2,4) 77: (3,1,2,1)
9: (3,1) 41: (2,3,1) 80: (2,5)
12: (1,3) 44: (2,1,3) 81: (2,4,1)
13: (1,2,1) 45: (2,1,2,1) 82: (2,3,2)
16: (5) 48: (1,5) 88: (2,1,4)
17: (4,1) 49: (1,4,1) 89: (2,1,3,1)
18: (3,2) 50: (1,3,2) 96: (1,6)
20: (2,3) 54: (1,2,1,2) 97: (1,5,1)
22: (2,1,2) 64: (7) 98: (1,4,2)
24: (1,4) 65: (6,1) 102: (1,3,1,2)
Partitions with a permutation of this type:
A345170, complement
A345165.
Factorizations with a permutation of this type:
A348379.
A003242 counts anti-run compositions.
A345164 counts alternating permutations of prime indices.
Statistics of standard compositions:
- Number of maximal anti-runs is
A333381.
- Number of distinct parts is
A334028.
Classes of standard compositions:
- Weakly decreasing compositions (partitions) are
A114994.
- Weakly increasing compositions (multisets) are
A225620.
- Non-alternating anti-runs are
A345169.
Cf.
A025048,
A025049,
A059893,
A106356,
A238279,
A335448,
A344604,
A344615,
A344653,
A344742,
A345163,
A348377.
-
stc[n_]:=Differences[Prepend[Join@@Position[ Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
wigQ[y_]:=Or[Length[y]==0,Length[Split[y]] ==Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Select[Range[0,100],wigQ@*stc]
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
A345192
Number of non-alternating compositions of n.
Original entry on oeis.org
0, 0, 1, 1, 4, 9, 20, 45, 99, 208, 437, 906, 1862, 3803, 7732, 15659, 31629, 63747, 128258, 257722, 517339, 1037652, 2079984, 4167325, 8346204, 16710572, 33449695, 66944254, 133959021, 268028868, 536231903, 1072737537, 2145905285, 4292486690, 8586035993, 17173742032, 34350108745, 68704342523, 137415168084
Offset: 0
The a(2) = 1 through a(6) = 20 compositions:
(11) (111) (22) (113) (33)
(112) (122) (114)
(211) (221) (123)
(1111) (311) (222)
(1112) (321)
(1121) (411)
(1211) (1113)
(2111) (1122)
(11111) (1131)
(1221)
(1311)
(2112)
(2211)
(3111)
(11112)
(11121)
(11211)
(12111)
(21111)
(111111)
The version for factorizations is
A348613.
A003242 counts anti-run compositions.
A032020 counts strict compositions.
A106356 counts compositions by number of maximal anti-runs.
A114901 counts compositions where each part is adjacent to an equal part.
A274174 counts compositions with equal parts contiguous.
A344604 counts alternating compositions with twins.
A344605 counts alternating patterns with twins.
A344654 counts non-twin partitions with no alternating permutation.
A345162 counts normal partitions with no alternating permutation.
A345164 counts alternating permutations of prime indices.
A345170 counts partitions w/ alternating permutation, ranked by
A345172.
A345165 counts partitions w/o alternating permutation, ranked by
A345171.
Patterns:
-
A128761 avoiding (1,2,3) adjacent.
-
A344614 avoiding (1,2,3) and (3,2,1) adjacent.
-
A344615 weakly avoiding (1,2,3) adjacent.
Cf.
A000070,
A008965,
A178470,
A238279,
A333755,
A335126,
A344606,
A344653,
A344740,
A345163,
A345166,
A345169,
A345173,
A348380.
-
wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!wigQ[#]&]],{n,0,15}]
A345170
Number of integer partitions of n with an alternating permutation.
Original entry on oeis.org
1, 1, 1, 2, 3, 5, 6, 10, 14, 19, 25, 36, 48, 64, 84, 111, 146, 191, 244, 315, 404, 515, 651, 823, 1035, 1295, 1616, 2011, 2492, 3076, 3787, 4650, 5695, 6952, 8463, 10280, 12460, 15059, 18162, 21858, 26254, 31463, 37641, 44933, 53554, 63704, 75653, 89683, 106162, 125445, 148020
Offset: 0
The a(1) = 1 through a(8) = 14 partitions:
(1) (2) (3) (4) (5) (6) (7) (8)
(21) (31) (32) (42) (43) (53)
(211) (41) (51) (52) (62)
(221) (321) (61) (71)
(311) (411) (322) (332)
(2211) (331) (422)
(421) (431)
(511) (521)
(3211) (611)
(22111) (3221)
(3311)
(4211)
(22211)
(32111)
Includes all strict partitions
A000009.
Including twins (x,x) gives
A344740.
The Heinz numbers of these partitions are
A345172.
The version for factorizations is
A348379.
A001250 counts alternating permutations.
A003242 counts anti-run compositions.
A344604 counts alternating compositions with twins.
Cf.
A000070,
A103919,
A335126,
A344605,
A344653,
A344654,
A344742,
A345164,
A345166,
A345167,
A345168,
A345195.
-
wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Table[Length[Select[IntegerPartitions[n],Select[Permutations[#],wigQ]!={}&]],{n,0,15}]
A025048
Number of up/down (initially ascending) compositions of n.
Original entry on oeis.org
1, 1, 1, 2, 3, 4, 7, 11, 16, 26, 41, 64, 100, 158, 247, 389, 612, 960, 1509, 2372, 3727, 5858, 9207, 14468, 22738, 35737, 56164, 88268, 138726, 218024, 342652, 538524, 846358, 1330160, 2090522, 3285526, 5163632, 8115323, 12754288, 20045027, 31503382
Offset: 0
From _Gus Wiseman_, Jan 15 2022: (Start)
The a(1) = 1 through a(7) = 11 up/down compositions:
(1) (2) (3) (4) (5) (6) (7)
(1,2) (1,3) (1,4) (1,5) (1,6)
(1,2,1) (2,3) (2,4) (2,5)
(1,3,1) (1,3,2) (3,4)
(1,4,1) (1,4,2)
(2,3,1) (1,5,1)
(1,2,1,2) (2,3,2)
(2,4,1)
(1,2,1,3)
(1,3,1,2)
(1,2,1,2,1)
(End)
The case of permutations is
A000111.
The version for patterns is
A350354.
These compositions are ranked by
A350355.
A025049
Number of down/up (initially descending) compositions of n.
Original entry on oeis.org
1, 1, 1, 2, 2, 4, 6, 9, 14, 23, 35, 55, 87, 136, 214, 337, 528, 830, 1306, 2051, 3223, 5067, 7962, 12512, 19667, 30908, 48574, 76343, 119982, 188565, 296358, 465764, 732006, 1150447, 1808078, 2841627, 4465992, 7018891, 11031101, 17336823, 27247087, 42822355
Offset: 0
From _Gus Wiseman_, Jan 28 2022: (Start)
The a(1) = 1 through a(8) = 14 down/up compositions:
(1) (2) (3) (4) (5) (6) (7) (8)
(2,1) (3,1) (3,2) (4,2) (4,3) (5,3)
(4,1) (5,1) (5,2) (6,2)
(2,1,2) (2,1,3) (6,1) (7,1)
(3,1,2) (2,1,4) (2,1,5)
(2,1,2,1) (3,1,3) (3,1,4)
(4,1,2) (3,2,3)
(2,1,3,1) (4,1,3)
(3,1,2,1) (5,1,2)
(2,1,3,2)
(2,1,4,1)
(3,1,3,1)
(4,1,2,1)
(2,1,2,1,2)
(End)
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
- Mohammed L. Nadji, Moussa Ahmia, Daniel F. Checa, and José L. Ramírez, Arndt Compositions with Restricted Parts, Palindromes, and Colored Variants, J. Int. Seq. (2025) Vol. 28, Issue 3, Article 25.3.6. See p. 12.
- Wikipedia, Alternating permutation
The case of permutations is
A000111.
The version for patterns is
A350354.
These compositions are ranked by
A350356.
-
doupQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]y[[m+1]]],{m,1,Length[y]-1}];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],doupQ]],{n,0,15}] (* Gus Wiseman, Jan 28 2022 *)
Comments