OFFSET
1,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,1,-8,2,4).
FORMULA
G.f.: x^3*(3*x-2)/((2*x-1)*(2*x^2-1)*(x^2+x-1)). - Vladeta Jovovic, Sep 03 2004
a(n) = 3*a(n-1) + a(n-2) - 8*a(n-3) + 2*a(n-4) + 4*a(n-5) for n > 5. - Jinyuan Wang, Mar 10 2020
From Gregory L. Simay, May 27 2021: (Start)
a(2*n) = 2^(2*n - 1) - 2^(n-1) - A000045(2*n).
a(2*n+1) = 2^(2*n) - A000045(2*n + 1). (End)
EXAMPLE
n=4: 2+1+1, 1+2+1, 1+1+2. Total=3.
MAPLE
G:=x^3*(3*x-2)/((2*x-1)*(2*x^2-1)*(x^2+x-1)): Gser:=series(G, x=0, 37): seq(coeff(Gser, x^n), n=1..35); # Emeric Deutsch, Feb 15 2005
# second Maple program
b:= proc(n, o, e) option remember; `if`(n=0, `if`(o and e, 1, 0),
add(`if`(irem(i, 2)=1, b(n-i, true, e),
b(n-i, o, true)), i=1..n))
end:
a:= n-> b(n, false$2):
seq(a(n), n=1..50); # Alois P. Heinz, Jun 11 2013
MATHEMATICA
e=(1-x^2)/(1-2x^2); o=(1-x^2)/(1-x-x^2); nn=30; Drop[CoefficientList[Series[(1-x)/(1-2x)-(o+e), {x, 0, nn}], x], 1] (* Geoffrey Critzer, Jan 18 2012 *)
CROSSREFS
Cf. A000041 (partitions), A006477 (partitions of n with at least 1 odd and 1 even part), A000009 (partitions into odd parts), A035363 (partitions into even parts); A000079 (compositions). Compositions into odd parts give Fibonacci numbers (A000045), into even parts gives 0, 1, 0, 2, 0, 4, 0, 8, 0, 16, 0, 32, 0, 64, ... (essentially A000079).
Cf. A007179.
KEYWORD
nonn
AUTHOR
Dubois Marcel (dubois.ml(AT)club-internet.fr), Sep 03 2004
EXTENSIONS
More terms from Emeric Deutsch, Feb 15 2005
STATUS
approved