OFFSET
0,3
COMMENTS
This is the number of nonzero terms in the n-th triangle of A360071.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
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
EXAMPLE
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.
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}]
PROG
(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
CROSSREFS
A116608 counts partitions by number of distinct parts.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jan 28 2023
EXTENSIONS
Terms a(31) and beyond from Andrew Howroyd, Jan 30 2023
STATUS
approved