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
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = A025147(n-1), n>1. - R. J. Mathar, Jul 31 2008
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)):
seq(a(n), n=0..100); # Alois P. Heinz, Feb 07 2014
# 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
N. J. A. Sloane, Sep 28 2008
STATUS
approved