|
|
A096765
|
|
Number of partitions of n into distinct parts, the least being 1.
|
|
25
|
|
|
0, 1, 0, 1, 1, 1, 2, 2, 3, 3, 5, 5, 7, 8, 10, 12, 15, 17, 21, 25, 29, 35, 41, 48, 56, 66, 76, 89, 103, 119, 137, 159, 181, 209, 239, 273, 312, 356, 404, 460, 522, 591, 669, 757, 853, 963, 1085, 1219, 1371, 1539, 1725, 1933, 2164, 2418, 2702, 3016, 3362, 3746, 4171, 4637
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,7
|
|
COMMENTS
|
The old entry with this sequence number was a duplicate of A071569.
a(n) is also the total number of 1's in all partitions of n into distinct parts. For n=6 there are partitions [6], [5,1], [4,2], [3,2,1] and only two contain a 1, hence a(6) = 2. - T. Amdeberhan, May 13 2012
a(n), n > 1 is the Euler transform of [0,1,1] joined with period [0,1]. - Georg Fischer, Aug 15 2020
|
|
LINKS
|
|
|
FORMULA
|
G.f.: x*Product_{j=2..infinity} (1+x^j). - R. J. Mathar, Jul 31 2008
G.f.: x / ((1 + x) * Product_{k>0} (1 - x^(2*k-1))). - Michael Somos, Sep 10 2016
G.f.: Sum_{k>0} x^(k*(k+1)/2) / Product_{j=1..k-1} (1 - x^j). - Michael Somos, Sep 10 2016
|
|
EXAMPLE
|
G.f. = x + x^3 + x^4 + x^5 + 2*x^6 + 2*x^7 + 3*x^8 + 3*x^9 + 5*x^10 + 5*x^11 + ...
|
|
MAPLE
|
b:= proc(n, i) option remember;
`if`(n=0, 1, `if`((i-1)*(i+2)/2<n, 0,
add(b(n-i*j, i-1), j=0..min(1, n/i))))
end:
a:= n-> `if`(n<1, 0, b(n-1$2)):
# Using the function EULER from Transforms (see link at the bottom of the page).
[0, 1, op(EULER([0, 1, seq(irem(n, 2), n=1..56)]))]; # Peter Luschny, Aug 19 2020
|
|
MATHEMATICA
|
p[_, 0] = 1; p[k_, n_] := p[k, n] = If[n < k, 0, p[k+1, n-k] + p[k+1, n]]; a[n_] := p[2, n-1]; Table[a[n], {n, 0, 59}] (* Jean-François Alcover, Apr 17 2014, after Reinhard Zumkeller *)
a[ n_] := SeriesCoefficient[ x / ((1 + x) Product[ 1 - x^j, {j, 1, n, 2}]), {x, 0, n}]; (* Michael Somos, Sep 10 2016 *)
a[ n_] := If[ n < 0, 0, SeriesCoefficient[ Sum[ x^(k (k + 1)/2) / Product[ 1 - x^j, {j, 1, k - 1}], {k, 1, Quotient[-1 + Sqrt[8 n + 1], 2]}], {x, 0, n}]]; (* Michael Somos, Sep 10 2016 *)
Join[{0}, Table[Count[Last /@ Select[IntegerPartitions@n, DeleteDuplicates[#] == # &], 1], {n, 66}]] (* Robert Price, Jun 13 2020 *)
|
|
PROG
|
(PARI) {a(n) = if( n<1, 0, polcoeff( x / ((1 + x) * prod(k=1, (n+1)\2, 1 - x^(2*k-1), 1 + O(x^n))), n))}; /* Michael Somos, Sep 10 2016 */
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|