A140652 Partial sums of A062968.
1, 2, 4, 6, 10, 13, 19, 24, 31, 38, 48, 55, 67, 78, 90, 102, 118, 131, 149, 164, 182, 201, 223, 240, 263, 286, 310, 333, 361, 384, 414, 441, 471, 502, 534, 562, 598, 633, 669, 702, 742, 777, 819, 858, 898, 941, 987, 1026, 1073, 1118, 1166, 1213, 1265, 1312
Offset: 1
A049820 a(n) = n - d(n), where d(n) is the number of divisors of n (A000005).
0, 0, 1, 1, 3, 2, 5, 4, 6, 6, 9, 6, 11, 10, 11, 11, 15, 12, 17, 14, 17, 18, 21, 16, 22, 22, 23, 22, 27, 22, 29, 26, 29, 30, 31, 27, 35, 34, 35, 32, 39, 34, 41, 38, 39, 42, 45, 38, 46, 44, 47, 46, 51, 46, 51, 48, 53, 54, 57, 48, 59, 58, 57, 57, 61, 58, 65
Offset: 1
Comments
a(n) is the number of non-divisors of n in 1..n. - Jaroslav Krizek, Nov 14 2009
Also equal to the number of partitions p of n such that max(p)-min(p) = 1. The number of partitions of n with max(p)-min(p) <= 1 is n; there is one with k parts for each 1 <= k <= n. max(p)-min(p) = 0 iff k divides n, leaving n-d(n) with a difference of 1. It is easiest to see this by looking at fixed k with increasing n: for k=3, starting with n=3 the partitions are [1,1,1], [2,1,1], [2,2,1], [2,2,2], [3,2,2], etc. - Giovanni Resta, Feb 06 2006 and Franklin T. Adams-Watters, Jan 30 2011
Number of positive numbers in n-th row of array T given by A049816.
Number of proper non-divisors of n. - Omar E. Pol, May 25 2010
a(n+2) is the sum of the n-th antidiagonal of A225145. - Richard R. Forberg, May 02 2013
For n > 2, number of nonzero terms in n-th row of triangle A051778. - Reinhard Zumkeller, Dec 03 2014
Number of partitions of n of the form [j,j,...,j,i] (j > i). Example: a(7)=5 because we have [6,1], [5,2], [4,3], [3,3,1], and [2,2,2,1]. - Emeric Deutsch, Sep 22 2016
Examples
a(7) = 5; the 5 non-divisors of 7 in 1..7 are 2, 3, 4, 5, and 6. The 5 partitions of 7 with max(p) - min(p) = 1 are [4,3], [3,2,2], [2,2,2,1], [2,2,1,1,1] and [2,1,1,1,1,1]. - _Emeric Deutsch_, Mar 01 2006
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- G. E. Andrews, M. Beck, N. Robbins, Partitions with fixed differences between largest and smallest parts, arXiv preprint arXiv:1406.3374 [math.NT], 2014-2015.
Crossrefs
Cf. A000005.
Cf. A161664 (partial sums).
Cf. A060990 (number of solutions to a(x) = n).
Cf. A045765 (numbers not occurring in this sequence).
Cf. A236561 (same sequence sorted into ascending order), A236562 (with also duplicates removed), A236565, A262901 and A262903.
Cf. A262511 (numbers that occur only once).
Cf. A055927 (positions of repeated terms).
Cf. A245388 (positions of squares).
Cf. A155043 (number of steps needed to reach zero when iterating a(n)), A262680 (number of nonzero squares encountered).
Cf. A259934 (an infinite trunk of the tree defined by edge-relation a(child) = parent, conjectured to be unique).
Programs
-
GAP
List([1..80],n->n-Tau(n)); # Muniru A Asiru, Sep 28 2018
-
Haskell
a049820 n = n - a000005 n -- Reinhard Zumkeller, Feb 06 2012
-
Maple
A049820 := n->n-numtheory[tau](n): seq(A049820(n), n=1..100);
-
Mathematica
Table[n - DivisorSigma[0, n], {n, 100}] (* Wesley Ivan Hurt, Nov 19 2014 *) Array[(# - DivisorSigma[0, #])&, 70] (* Vincenzo Librandi, Dec 29 2015 *)
-
PARI
a(n)=n-numdiv(n)
-
Scheme
(define (A049820 n) (- n (A000005 n))) ;; Antti Karttunen, Nov 27 2015
Formula
a(n) = Sum_{k=1..n} ceiling(n/k)-floor(n/k). - Benoit Cloitre, May 11 2003
G.f.: Sum_{k>0} x^(2*k+1)/(1-x^k)/(1-x^(k+1)). - Emeric Deutsch, Mar 01 2006
a(n) = A006590(n) - A006218(n) = A161886(n) - A000005(n) - A006218(n) + 1 for n >= 1. - Jaroslav Krizek, Nov 14 2009
a(n) = Sum_{k=1..n} ((n mod k) + (-n mod k))/k. - Wesley Ivan Hurt, Dec 28 2015
G.f.: Sum_{j>=2} (x^(j+1)*(1-x^(j-1))/(1-x^j))/(1-x). - Emeric Deutsch, Sep 22 2016
Dirichlet g.f.: zeta(s-1)- zeta(s)^2. - Ilya Gutkovskiy, Apr 12 2017
a(n) = Sum_{i=1..n-1} sign(i mod n-i). - Wesley Ivan Hurt, Sep 27 2018
Extensions
Edited by Franklin T. Adams-Watters, Jan 30 2012
A064428 Number of partitions of n with nonnegative crank.
1, 0, 1, 2, 3, 4, 6, 8, 12, 16, 23, 30, 42, 54, 73, 94, 124, 158, 206, 260, 334, 420, 532, 664, 835, 1034, 1288, 1588, 1962, 2404, 2953, 3598, 4392, 5328, 6466, 7808, 9432, 11338, 13632, 16326, 19544, 23316, 27806, 33054, 39273, 46534, 55096, 65076, 76808
Offset: 0
Keywords
Comments
For a partition p, let l(p) = largest part of p, w(p) = number of 1's in p, m(p) = number of parts of p larger than w(p). The crank of p is given by l(p) if w(p) = 0, otherwise m(p)-w(p).
From Gus Wiseman, Mar 30 2021 and May 21 2022: (Start)
Also the number of even-length compositions of n with alternating parts strictly decreasing, or properly 2-colored partitions (proper = no equal parts of the same color) with the same number of parts of each color, or ordered pairs of strict partitions of the same length with total n. The odd-length case is A001522, and there are a total of A000041 compositions with alternating parts strictly decreasing (see A342528 for a bijective proof). The a(2) = 1 through a(7) = 8 ordered pairs of strict partitions of the same length are:
(1)(1) (1)(2) (1)(3) (1)(4) (1)(5) (1)(6)
(2)(1) (2)(2) (2)(3) (2)(4) (2)(5)
(3)(1) (3)(2) (3)(3) (3)(4)
(4)(1) (4)(2) (4)(3)
(5)(1) (5)(2)
(21)(21) (6)(1)
(21)(31)
(31)(21)
Conjecture: Also the number of integer partitions y of n without a fixed point y(i) = i, ranked by A352826. This is stated at A238394, but Resta tells me he may not have had a proof. The a(2) = 1 through a(7) = 8 partitions without a fixed point are:
(2) (3) (4) (5) (6) (7)
(21) (31) (41) (33) (43)
(211) (311) (51) (61)
(2111) (411) (331)
(3111) (511)
(21111) (4111)
(31111)
(211111)
The version for compositions is A238351.
This is column k = 0 of A352833.
The above conjecture is true. See Section 4 of the Blecher-Knopfmacher paper in the Links section. - Jeremy Lovejoy, Sep 26 2022
Examples
G.f. = 1 + x^2 + 2*x^3 + 3*x^4 + 4*x^5 + 6*x^6 + 8*x^7 + 12*x^8 + 16*x^9 + 23*x^10 + ... - _Michael Somos_, Jan 15 2018 From _Gus Wiseman_, May 21 2022: (Start) The a(0) = 1 through a(8) = 12 partitions with nonnegative crank: () . (2) (3) (4) (5) (6) (7) (8) (21) (22) (32) (33) (43) (44) (31) (41) (42) (52) (53) (221) (51) (61) (62) (222) (322) (71) (321) (331) (332) (421) (422) (2221) (431) (521) (2222) (3221) (3311) (End)
References
- B. C. Berndt, Ramanujan's Notebooks Part III, Springer-Verlag, see p. 18 Entry 9 Corollary (i).
- G. E. Andrews, B. C. Berndt, Ramanujan's Lost Notebook Part I, Springer, see p. 169 Entry 6.7.1.
Links
- Vaclav Kotesovec, Table of n, a(n) for n = 0..10000
- George E. Andrews and David Newman, The Minimal Excludant in Integer Partitions, J. Int. Seq., Vol. 23 (2020), Article 20.2.3.
- Cody Armond and Oliver T. Dasbach, Rogers-Ramanujan type identities and the head and tail of the colored Jones polynomial, arXiv:1106.3948 [math.GT], 2011.
- Cristina Ballantine and Mircea Merca, Bisected theta series, least r-gaps in partitions, and polygonal numbers, arXiv:1710.05960 [math.CO], 2017.
- Rupam Barman and Ajit Singh, On Mex-related partition functions of Andrews and Newman, arXiv:2009.11602 [math.NT], 2020.
- Aubrey Blecher and Arnold Knopfmacher, Fixed points and matching points in partitions, Ramanujan J. 58 (2022), 23-41.
- Brian Hopkins, James A. Sellers, and Ae Ja Yee, Combinatorial Perspectives on the Crank and Mex Partition Statistics, arXiv:2108.09414 [math.CO], 2021.
- Mbavhalelo Mulokwe and Konstantinos Zoubos, Free fermions, neutrality and modular transformations, arXiv:2403.08531 [hep-th], 2024.
Crossrefs
Programs
-
Mathematica
a[ n_] := If[ n < 0, 0, SeriesCoefficient[ Sum[ (-1)^k x^(k (k + 1)/2) , {k, 0, (Sqrt[1 + 8 n] - 1)/2}] / QPochhammer[ x], {x, 0, n}]]; (* Michael Somos, Jan 15 2018 *) a[ n_] := If[ n < 0, 0, SeriesCoefficient[ Sum[ x^(k (k + 1)) / QPochhammer[ x, x, k]^2 , {k, 0, (Sqrt[1 + 4 n] - 1)/2}], {x, 0, n}]]; (* Michael Somos, Jan 15 2018 *) ck[y_]:=With[{w=Count[y,1]},If[w==0,If[y=={},0,Max@@y],Count[y,?(#>w&)]-w]];Table[Length[Select[IntegerPartitions[n],ck[#]>=0&]],{n,0,30}] (* _Gus Wiseman, Mar 30 2021 *) ici[q_]:=And@@Table[q[[i]]>q[[i+2]],{i,Length[q]-2}]; Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n], EvenQ@*Length],ici]],{n,0,15}] (* Gus Wiseman, Mar 30 2021 *)
-
PARI
{a(n) = if( n<0, 0, polcoeff( sum(k=0, (sqrtint(1 + 8*n) -1)\2, (-1)^k * x^((k+k^2)/2)) / eta( x + x * O(x^n)), n))}; /* Michael Somos, Jul 28 2003 */
Formula
G.f.: (Sum_{k>=0} (-1)^k * x^(k(k+1)/2)) / (Product_{k>0} 1-x^k). - Michael Somos, Jul 28 2003
G.f.: Sum_{i>=0} x^(i*(i+1)) / (Product_{j=1..i} 1-x^j )^2. - Jon Perry, Jul 18 2004
a(n) ~ exp(Pi*sqrt(2*n/3)) / (8*n*sqrt(3)). - Vaclav Kotesovec, Sep 26 2016
G.f.: (Sum_{i>=0} x^i / (Product_{j=1..i} 1-x^j)^2 ) * (Product_{k>0} 1-x^k). - Li Han, May 23 2020
A065608 Sum of divisors of n minus the number of divisors of n.
0, 1, 2, 4, 4, 8, 6, 11, 10, 14, 10, 22, 12, 20, 20, 26, 16, 33, 18, 36, 28, 32, 22, 52, 28, 38, 36, 50, 28, 64, 30, 57, 44, 50, 44, 82, 36, 56, 52, 82, 40, 88, 42, 78, 72, 68, 46, 114, 54, 87, 68, 92, 52, 112, 68, 112, 76, 86, 58, 156, 60, 92, 98, 120, 80, 136, 66, 120, 92
Offset: 1
Comments
Number of permutations p of {1,2,...,n} such that p(k)-k takes exactly two distinct values. Example: a(4)=4 because we have 4123, 3412, 2143 and 2341. - Max Alekseyev and Emeric Deutsch, Dec 22 2006
Number of solutions to the Diophantine equation xy + yz = n, with x,y,z >= 1.
In other words, number of ways to write n = (a + b) * k for positive integers a, b, k. - Gus Wiseman, Mar 25 2021
From Gus Wiseman, Mar 25 2021: (Start)
Also the number of compositions of n into an even number of parts with alternating parts equal. These are finite even-length sequences q of positive integers summing to n such that q(i) = q(i+2) for all possible i. For example, the a(2) = 1 through a(8) = 11 compositions are:
(1,1) (1,2) (1,3) (1,4) (1,5) (1,6) (1,7)
(2,1) (2,2) (2,3) (2,4) (2,5) (2,6)
(3,1) (3,2) (3,3) (3,4) (3,5)
(1,1,1,1) (4,1) (4,2) (4,3) (4,4)
(5,1) (5,2) (5,3)
(1,2,1,2) (6,1) (6,2)
(2,1,2,1) (7,1)
(1,1,1,1,1,1) (1,3,1,3)
(2,2,2,2)
(3,1,3,1)
(1,1,1,1,1,1,1,1)
The odd-length version is A062968.
The version with alternating parts weakly decreasing is A114921, or A342528 if odd-length compositions are included.
The version with alternating parts unequal is A342532, or A224958 if odd-length compositions are included (unordered: A339404/A000726).
Allowing odd lengths as well as even gives A342527.
(End)
Inverse Möbius transform of n-1. - Wesley Ivan Hurt, Jun 29 2024
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..20000 (first 1000 terms from T. D. Noe)
- M. Alekseyev, E. Deutsch, and J. H. Steelman, Solution to problem 11281, Amer. Math. Monthly, 116, No. 5, 2009, p. 465.
- George E. Andrews, Stacked lattice boxes, Ann. Comb. 3 (1999), 115-130. See L_2(n).
- Joerg Arndt, On computing the generalized Lambert series, arXiv:1202.6525v3 [math.CA], (2012).
- Masato Kobayashi, New recurrences for divisor sum functions and triangular numbers, arXiv:2207.05831 [math.NT], 2022.
Crossrefs
Starting (1, 2, 4, 4, 8, 6, ...), = row sums of triangle A077478. - Gary W. Adamson, Nov 12 2007
Starting with "1" = row sums of triangle A176919. - Gary W. Adamson, Apr 29 2010
Column k=2 of A125182.
Programs
-
GAP
List([1..100],n->Sigma(n)-Tau(n)); # Muniru A Asiru, Mar 19 2018
-
Maple
with(numtheory): seq(sigma(n)-tau(n),n=1..70); # Emeric Deutsch, Dec 22 2006
-
Mathematica
Table[DivisorSigma[1,n]-DivisorSigma[0,n], {n,100}] (* Wesley Ivan Hurt, Dec 26 2013 *)
-
PARI
a(n) = sigma(n) - numdiv(n); \\ Harry J. Smith, Oct 23 2009
-
Python
from math import prod from sympy import factorint def A065608(n): f = factorint(n).items() return prod((p**(e+1)-1)//(p-1) for p, e in f)-prod(e+1 for p,e in f) # Chai Wah Wu, Jul 16 2022
Formula
a(n) = Sum_{d|n} (d-1). - Wesley Ivan Hurt, Dec 26 2013
G.f.: Sum_{k>=1} x^(2*k)/(1-x^k)^2. - Benoit Cloitre, Apr 21 2003
G.f.: Sum_{n>=1} (n-1)*x^n/(1-x^n). - Joerg Arndt, Jan 30 2011
L.g.f.: -log(Product_{k>=1} (1 - x^k)^(1-1/k)) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, Mar 18 2018
G.f.: Sum_{n >= 1} q^(n^2)*( (n - 1) + q^n - (n - 1)*q^(2*n) )/(1 - q^n)^2 - differentiate equation 1 in Arndt with respect to t, then set x = q and t = q. - Peter Bala, Jan 22 2021
a(n) = n * A010054(n) - Sum_{k>=1} a(n - k*(k+1)/2), assuming a(n) = 0 for n <= 0 (Kobayashi, 2022). - Amiram Eldar, Jun 23 2023
A064410 Number of partitions of n with zero crank.
0, 0, 1, 1, 1, 1, 1, 2, 2, 4, 4, 7, 7, 11, 12, 17, 19, 27, 30, 41, 48, 62, 73, 95, 110, 140, 166, 206, 243, 302, 354, 435, 513, 622, 733, 887, 1039, 1249, 1467, 1750, 2049, 2438, 2847, 3371, 3934, 4634, 5398, 6343, 7367, 8626, 10009, 11677, 13521, 15737, 18184
Offset: 1
Comments
For a partition p, let l(p) = largest part of p, w(p) = number of 1's in p, m(p) = number of parts of p larger than w(p). The crank of p is given by l(p) if w(p) = 0, otherwise m(p)-w(p).
Examples
a(10)=4 because there are 4 partitions of 10 with zero crank: 1+1+2+3+3, 1+1+4+4, 1+1+3+5 and 1+9. From _Gus Wiseman_, Apr 02 2021: (Start) The a(3) = 1 through a(14) = 11 partitions (A..D = 10..13): 21 31 41 51 61 71 81 91 A1 B1 C1 D1 3311 4311 4411 5411 5511 6511 6611 5311 6311 6411 7411 7511 33211 43211 7311 8311 8411 44211 54211 9311 53211 63211 55211 332211 432211 64211 73211 442211 532211 3322211 (End)
Links
- Alois P. Heinz and Vaclav Kotesovec, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Alois P. Heinz)
- Brian Hopkins and James A. Sellers, On Blecher and Knopfmacher's Fixed Points for Integer Partitions, arXiv:2305.05096 [math.CO], 2023. Mentions this sequence.
- Brian Hopkins, James A. Sellers, and Dennis Stanton, Dyson's Crank and the Mex of Integer Partitions, arXiv:2009.10873 [math.CO], 2020. Mentions this sequence.
Crossrefs
The version for positive crank is A001522.
Central column of A064391.
The version for nonnegative crank is A064428.
The Heinz numbers of these partitions are A342192.
A003242 counts anti-run compositions.
A224958 counts compositions with alternating parts unequal.
A257989 gives the crank of the partition with Heinz number n.
Programs
-
Mathematica
nmax = 60; Rest[CoefficientList[Series[x - 1 + Sum[(-1)^k*(x^(k*(k + 1)/2) - x^(k*(k - 1)/2)), {k, 1, nmax}] / Product[1 - x^k, {k, 1, nmax}], {x, 0, nmax}], x]] (* Vaclav Kotesovec, Sep 26 2016 *) Flatten[{0, Table[PartitionsP[n] - 2*Sum[(-1)^(j+1)*PartitionsP[n - j*((j+1)/2)], {j, 1, Floor[(Sqrt[8*n + 1] - 1)/2]}], {n, 2, 60}]}] (* Vaclav Kotesovec, Sep 26 2016 *) ck[y_]:=With[{w=Count[y,1]},If[w==0,Max@@y,Count[y,_?(#>w&)]-w]]; Table[Length[Select[IntegerPartitions[n],ck[#]==0&]],{n,0,30}] (* Gus Wiseman, Apr 02 2021 *)
-
Sage
[[p.crank() for p in Partitions(n)].count(0) for n in (1..20)] # Peter Luschny, Sep 15 2014
Formula
a(n) ~ exp(Pi*sqrt(2*n/3)) * Pi / (3 * 2^(9/2) * n^(3/2)). - Vaclav Kotesovec, May 06 2018
a(n > 1) = A064428(n) - A001522(n), where A001522/A064428 count odd/even-length compositions with alternating parts strictly decreasing. - Gus Wiseman, Apr 02 2021
From Peter Bala, Feb 03 2024: (Start)
Equivalently, the g.f. A(x) = (1 - x) * Sum_{n >= 1} x^(n*(n+2)) / Product{k = 1..n} (1 - x^k)^2. (End)
Extensions
More terms from Reiner Martin, Dec 26 2001
A342528 Number of compositions with alternating parts weakly decreasing (or weakly increasing).
1, 1, 2, 4, 7, 12, 20, 32, 51, 79, 121, 182, 272, 399, 582, 839, 1200, 1700, 2394, 3342, 4640, 6397, 8771, 11955, 16217, 21878, 29386, 39285, 52301, 69334, 91570, 120465, 157929, 206313, 268644, 348674, 451185, 582074, 748830, 960676, 1229208, 1568716, 1997064
Offset: 0
Keywords
Comments
These are finite sequences q of positive integers summing to n such that q(i) >= q(i+2) for all possible i.
The strict case (alternating parts are strictly decreasing) is A000041. Is there a bijective proof?
Yes. Construct a Ferrers diagram by placing odd parts horizontally and even parts vertically in a fishbone pattern. The resulting Ferrers diagram will be for an ordinary partition and the process is reversible. It does not appear that this method can be applied to give a formula for this sequence. - Andrew Howroyd, Mar 25 2021
Examples
The a(1) = 1 through a(6) = 20 compositions: (1) (2) (3) (4) (5) (6) (11) (12) (13) (14) (15) (21) (22) (23) (24) (111) (31) (32) (33) (121) (41) (42) (211) (131) (51) (1111) (212) (141) (221) (222) (311) (231) (1211) (312) (2111) (321) (11111) (411) (1212) (1311) (2121) (2211) (3111) (12111) (21111) (111111)
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000 (first 501 terms from Andrew Howroyd)
- Gus Wiseman, Sequences counting and ranking partitions and compositions by their differences and quotients.
Crossrefs
Programs
-
Maple
b:= proc(n, i, j) option remember; `if`(n=0, 1, `if`(i<1, 0, b(n, i-1, j)+b(n-i, min(n-i, j), min(n-i, i)))) end: a:= n-> b(n$3): seq(a(n), n=0..42); # Alois P. Heinz, Jan 16 2025
-
Mathematica
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],GreaterEqual@@Plus@@@Reverse/@Partition[#,2,1]&]],{n,0,15}]
-
PARI
seq(n)={my(p=1/prod(k=1, n, 1-y*x^k + O(x*x^n))); Vec(1+sum(k=1, n, polcoef(p,k,y)*(polcoef(p,k-1,y) + polcoef(p,k,y))))} \\ Andrew Howroyd, Mar 24 2021
Formula
G.f.: Sum_{k>=0} ([y^k] P(x,y))*([y^k] (1 + y)*P(x,y)), where P(x,y) = Product_{k>=1} 1/(1 - y*x^k). - Andrew Howroyd, Jan 16 2025
Extensions
Terms a(21) and beyond from Andrew Howroyd, Mar 24 2021
A342527 Number of compositions of n with alternating parts equal.
1, 1, 2, 4, 6, 8, 11, 12, 16, 17, 21, 20, 29, 24, 31, 32, 38, 32, 46, 36, 51, 46, 51, 44, 69, 51, 61, 60, 73, 56, 87, 60, 84, 74, 81, 76, 110, 72, 91, 88, 115, 80, 123, 84, 117, 112, 111, 92, 153, 101, 132, 116, 139, 104, 159, 120, 161, 130, 141, 116, 205, 120, 151, 156, 178, 142, 195, 132, 183, 158
Offset: 0
Keywords
Comments
These are finite sequences q of positive integers summing to n such that q(i) = q(i+2) for all possible i.
Examples
The a(1) = 1 through a(8) = 16 compositions: (1) (2) (3) (4) (5) (6) (7) (8) (11) (12) (13) (14) (15) (16) (17) (21) (22) (23) (24) (25) (26) (111) (31) (32) (33) (34) (35) (121) (41) (42) (43) (44) (1111) (131) (51) (52) (53) (212) (141) (61) (62) (11111) (222) (151) (71) (1212) (232) (161) (2121) (313) (242) (111111) (12121) (323) (1111111) (1313) (2222) (3131) (21212) (11111111)
Links
Crossrefs
The odd-length case is A062968.
The even-length case is A065608.
The version with alternating parts weakly decreasing is A342528.
A000005 counts constant compositions.
A000041 counts weakly increasing (or weakly decreasing) compositions.
A000203 adds up divisors.
A002843 counts compositions with all adjacent parts x <= 2y.
A003242 counts anti-run compositions.
A175342 counts compositions with constant differences.
A342495 counts compositions with constant first quotients.
Programs
-
Mathematica
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],SameQ@@Plus@@@Reverse/@Partition[#,2,1]&]],{n,0,15}]
A114921 Number of unimodal compositions of n+2 where the maximal part appears exactly twice.
1, 0, 1, 2, 4, 6, 11, 16, 27, 40, 63, 92, 141, 202, 299, 426, 614, 862, 1222, 1694, 2362, 3242, 4456, 6054, 8229, 11072, 14891, 19872, 26477, 35050, 46320, 60866, 79827, 104194, 135703, 176008, 227791, 293702, 377874, 484554, 620011, 790952, 1006924
Offset: 0
Keywords
Comments
Old name was: Expansion of a q-series.
a(n) is also the number of 2-colored partitions of n with the same number of parts in each color. - Shishuo Fu, May 30 2017
From Gus Wiseman, Mar 25 2021: (Start)
Also the number of even-length compositions of n with alternating parts weakly decreasing. Allowing odd lengths also gives A342528. The version with alternating parts strictly decreasing appears to be A064428. The a(2) = 1 through a(7) = 16 compositions are:
(1,1) (1,2) (1,3) (1,4) (1,5) (1,6)
(2,1) (2,2) (2,3) (2,4) (2,5)
(3,1) (3,2) (3,3) (3,4)
(1,1,1,1) (4,1) (4,2) (4,3)
(1,2,1,1) (5,1) (5,2)
(2,1,1,1) (1,2,1,2) (6,1)
(1,3,1,1) (1,3,1,2)
(2,1,2,1) (1,4,1,1)
(2,2,1,1) (2,2,1,2)
(3,1,1,1) (2,2,2,1)
(1,1,1,1,1,1) (2,3,1,1)
(3,1,2,1)
(3,2,1,1)
(4,1,1,1)
(1,2,1,1,1,1)
(2,1,1,1,1,1)
(End)
Examples
From _Joerg Arndt_, Jun 10 2013: (Start) There are a(7)=16 such compositions of 7+2=9 where the maximal part appears twice: 01: [ 1 1 1 1 1 2 2 ] 02: [ 1 1 1 1 2 2 1 ] 03: [ 1 1 1 2 2 1 1 ] 04: [ 1 1 1 3 3 ] 05: [ 1 1 2 2 1 1 1 ] 06: [ 1 1 3 3 1 ] 07: [ 1 2 2 1 1 1 1 ] 08: [ 1 2 3 3 ] 09: [ 1 3 3 1 1 ] 10: [ 1 3 3 2 ] 11: [ 1 4 4 ] 12: [ 2 2 1 1 1 1 1 ] 13: [ 2 3 3 1 ] 14: [ 3 3 1 1 1 ] 15: [ 3 3 2 1 ] 16: [ 4 4 1 ] (End)
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..10000
- S. Fu and D. Tang, On a generalized crank for k-colored partitions, arXiv:1705.10067 [math.CO], 2017.
- B. Kim and J. Lovejoy, Ramanujan-type partial theta identities and rank differences for special unimodal sequences, Annals of Combinatorics, 19 (2015), 705-733.
Crossrefs
Cf. A226541 (max part appears three times), A188674 (max part m appears m times), A001523 (max part appears any number of times).
Column k=2 of A247255.
A000041 counts weakly increasing (or weakly decreasing) compositions.
A000203 adds up divisors.
A002843 counts compositions with all adjacent parts x <= 2y.
A003242 counts anti-run compositions.
A034008 counts even-length compositions.
A065608 counts even-length compositions with alternating parts equal.
A342528 counts compositions with alternating parts weakly decreasing.
A342532 counts even-length compositions with alternating parts unequal.
Programs
-
Mathematica
max = 50; s = (1+Sum[2*(-1)^k*q^(k(k+1)/2), {k, 1, max}])/QPochhammer[q]^2+ O[q]^max; CoefficientList[s, q] (* Jean-François Alcover, Nov 30 2015, from 1st g.f. *) wdw[q_]:=And@@Table[q[[i]]>=q[[i+2]],{i,Length[q]-2}]; Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],EvenQ[Length[#]]&],wdw]],{n,0,15}] (* Gus Wiseman, Mar 25 2021 *)
-
PARI
{a(n) = if( n<0, 0, polcoeff( sum(k=0, n\2, x^(2*k) / prod(i=1, k, 1 - x^i, 1 + x * O(x^n))^2), n))};
-
PARI
{a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( sum(k=1, sqrtint(8*n + 1)\2, 2*(-1)^k * x^((k^2+k)/2), 1 + A) / eta(x + A)^2, n))};
Formula
G.f.: 1 + Sum_{k>0} (x^k / ((1-x)(1-x^2)...(1-x^k)))^2 = (1 + Sum_{k>0} 2 (-1)^k x^((k^2+k)/2) ) / (Product_{k>0} (1 - x^k))^2.
G.f.: 1 + x*(1 - G(0))/(1-x) where G(k) = 1 - x/(1-x^(k+1))^2/(1-x/(x-1/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 23 2013
a(n) ~ Pi * exp(2*Pi*sqrt(n/3)) / (16 * 3^(5/4) * n^(7/4)). - Vaclav Kotesovec, Oct 24 2018
Extensions
New name from Joerg Arndt, Jun 10 2013
A342532 Number of even-length compositions of n with alternating parts distinct.
1, 0, 1, 2, 3, 4, 9, 14, 28, 44, 83, 136, 250, 424, 757, 1310, 2313, 4018, 7081, 12314, 21650, 37786, 66264, 115802, 202950, 354858, 621525, 1087252, 1903668, 3330882, 5831192, 10204250, 17862232, 31260222, 54716913, 95762576, 167614445, 293356422, 513456686
Offset: 0
Keywords
Comments
These are finite even-length sequences q of positive integers summing to n such that q(i) != q(i+2) for all possible i.
Examples
The a(2) = 1 through a(7) = 14 compositions: (1,1) (1,2) (1,3) (1,4) (1,5) (1,6) (2,1) (2,2) (2,3) (2,4) (2,5) (3,1) (3,2) (3,3) (3,4) (4,1) (4,2) (4,3) (5,1) (5,2) (1,1,2,2) (6,1) (1,2,2,1) (1,1,2,3) (2,1,1,2) (1,1,3,2) (2,2,1,1) (1,2,3,1) (1,3,2,1) (2,1,1,3) (2,3,1,1) (3,1,1,2) (3,2,1,1)
Links
- Andrew Howroyd, Table of n, a(n) for n = 0..500
Crossrefs
Programs
-
Mathematica
qdq[q_]:=And@@Table[q[[i]]!=q[[i+2]],{i,Length[q]-2}]; Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],EvenQ[Length[#]]&],qdq]],{n,0,15}]
-
PARI
\\ here gf gives A106351 as g.f. gf(n, y)={1/(1 - sum(k=1, n, (-1)^(k+1)*x^k*y^k/(1-x^k) + O(x*x^n)))} seq(n)={my(p=gf(n,y)); Vec(sum(k=0, n\2, polcoef(p,k,y)^2))} \\ Andrew Howroyd, Apr 16 2021
Formula
G.f.: 1 + Sum_{k>=1} B_k(x)^2 where B_k(x) is the g.f. of column k of A106351. - Andrew Howroyd, Apr 16 2021
Extensions
Terms a(24) and beyond from Andrew Howroyd, Apr 16 2021
A342343 Number of strict compositions of n with alternating parts strictly decreasing.
1, 1, 1, 3, 3, 5, 8, 10, 13, 18, 27, 32, 44, 55, 73, 97, 121, 151, 194, 240, 299, 384, 465, 576, 706, 869, 1051, 1293, 1572, 1896, 2290, 2761, 3302, 3973, 4732, 5645, 6759, 7995, 9477, 11218, 13258, 15597, 18393, 21565, 25319, 29703, 34701, 40478, 47278, 54985
Offset: 0
Keywords
Comments
These are finite odd-length sequences q of distinct positive integers summing to n such that q(i) > q(i+2) for all possible i.
Examples
The a(1) = 1 through a(8) = 13 compositions: (1) (2) (3) (4) (5) (6) (7) (8) (1,2) (1,3) (1,4) (1,5) (1,6) (1,7) (2,1) (3,1) (2,3) (2,4) (2,5) (2,6) (3,2) (4,2) (3,4) (3,5) (4,1) (5,1) (4,3) (5,3) (2,3,1) (5,2) (6,2) (3,1,2) (6,1) (7,1) (3,2,1) (2,4,1) (2,5,1) (4,1,2) (3,4,1) (4,2,1) (4,1,3) (4,3,1) (5,1,2) (5,2,1)
Links
- Andrew Howroyd, Table of n, a(n) for n = 0..1000
Crossrefs
The non-strict odd-length case is A001522.
Strict compositions in general are counted by A032020
The non-strict even-length case is A064428.
The case of reversed partitions is A065033.
A000726 counts partitions with alternating parts unequal.
A003242 counts anti-run compositions.
A027193 counts odd-length compositions.
A034008 counts even-length compositions.
A064391 counts partitions by crank.
A064410 counts partitions of crank 0.
A224958 counts compositions with alternating parts unequal.
A257989 gives the crank of the partition with Heinz number n.
A325548 counts compositions with strictly decreasing differences.
A342194 counts strict compositions with equal differences.
A342527 counts compositions with alternating parts equal.
Programs
-
Mathematica
ici[q_]:=And@@Table[q[[i]]>q[[i+2]],{i,Length[q]-2}]; Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],UnsameQ@@#&],ici]],{n,0,15}]
-
PARI
seq(n)={my(p=prod(k=1, n, 1 + y*x^k + O(x*x^n))); Vec(sum(k=0, n, binomial(k, k\2) * polcoef(p,k,y)))} \\ Andrew Howroyd, Apr 16 2021
Formula
G.f.: Sum_{k>=0} binomial(k,floor(k/2)) * [y^k](Product_{j>=1} 1 + y*x^j). - Andrew Howroyd, Apr 16 2021
Comments
Examples
Links
Crossrefs
Programs
Mathematica
PARI
Formula