A360072 Number of pairs of positive integers (k,i) such that k >= i and there exists an integer partition of n of length k with i distinct parts.
0, 1, 2, 3, 5, 5, 9, 9, 13, 14, 18, 19, 26, 25, 30, 34, 39, 40, 48, 48, 56, 59, 64, 67, 78, 78, 84, 89, 97, 99, 111, 111, 121, 125, 131, 137, 149, 149, 158, 165, 176, 177, 190, 191, 202, 210, 216, 222, 238, 239, 250, 256, 266, 270, 284, 289, 302, 307, 316, 323
Offset: 0
Keywords
Examples
The a(5) = 5 pairs are: (1,1), (2,2), (3,2), (4,2), (5,1). The pair (3,3) is absent because it is not possible to partition 5 into 3 parts, all 3 of which are distinct. The a(6) = 9 pairs are: (1,1), (2,1), (2,2), (3,1), (3,2), (3,3), (4,2), (5,2), (6,1). The pair (3,3) is present because (3,2,1) is a partition of 6 into 3 parts, all 3 of which are distinct.
Links
- Andrew Howroyd, Table of n, a(n) for n = 0..1000
Crossrefs
Programs
-
Mathematica
Table[Count[Flatten[Sign[Table[Length[Select[IntegerPartitions[n], Length[#]==k&&Length[Union[#]]==i&]],{k,1,n},{i,1,k}]]],1],{n,0,30}]
-
PARI
a(n) = if(n < 1, 0, numdiv(n) + sum(k=2, (sqrtint(8*n+1)-1)\2, n-binomial(k+1,2)+1)) \\ Andrew Howroyd, Jan 30 2023
Formula
a(n) = A000005(n) + Sum_{k=2..floor((sqrt(8*n+1)-1)/2)} (1 + n - binomial(k+1,2)) for n > 0. - Andrew Howroyd, Jan 30 2023
Extensions
Terms a(31) and beyond from Andrew Howroyd, Jan 30 2023
Comments