OFFSET
0,3
COMMENTS
Equivalently, the number of compositions of n with at most one part size having odd multiplicity.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000 (first 201 terms from Andrew Howroyd)
EXAMPLE
Case n=4: The 6 compositions are: 4, 211, 121, 112, 22, 1111.
Case n=5: The 8 compositions are: 5, 311, 131, 113, 122, 212, 221, 11111.
MAPLE
b:= proc(n, i, p, t) option remember; `if`(n=0 or i=1,
`if`(t and n::odd, 0, (n+p)!/n!), add(`if`(t and j::odd,
0, b(n-i*j, i-1, p+j, t or j::odd))/j!, j=0..n/i))
end:
a:= n-> b(n$2, 0, false):
seq(a(n), n=0..40); # Alois P. Heinz, Dec 02 2018
MATHEMATICA
b[n_, i_, p_, t_] := b[n, i, p, t] = If[n == 0 || i == 1, If[t && OddQ[n], 0, (n+p)!/n!], Sum[If[t && OddQ[j], 0, b[n-i*j, i-1, p+j, t || OddQ[j]]]/ j!, {j, 0, n/i}]];
a[n_] := b[n, n, 0, False];
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Aug 13 2019, after Alois P. Heinz *)
PROG
(PARI) a(n)={sum(k=0, n\2, my(p=prod(i=1, k, 1 + sum(j=1, k\i, x^(i*j)*y^(2*j)/(2*j + (i==n-2*k))!) + O(x*x^k))); subst(serlaplace(polcoef(p, k)*y^(2*k<n)), y, 1))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrew Howroyd, Nov 27 2018
STATUS
approved