OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
G.f.: x*A(x)^2 + x^2*B(x)^2 - 2*x^3*C(x)^3 where A(x)=1/(1 - (x/(1-x)-x)), B(x)=1/(1 - (x/(1-x)-x^2)), C(x)=1/(1 - (x/(1-x)-x-x^2)).
a(n) ~ c * n / (2^(n-1) * d^n), where c = 0.02749202171174083217... is the root of the equation -1 + 18*c + 552*c^2 + 4232*c^3 = 0 and d = 0.2849201454990266329... is the root of the equation -1 + 4*d - 4*d^2 + 8*d^3 = 0. - Vaclav Kotesovec, May 01 2014
EXAMPLE
a(4) = 5 because we have: 1+3, 3+1, 1+1+2, 1+2+1, 2+1+1.
MATHEMATICA
nn=30; a=1/(1-(x/(1-x)-x)); b=1/(1-(x/(1-x)-x^2)); c=1/(1-(x/(1-x)-x-x^2)); CoefficientList[Series[a^2x +b^2x^2-2 c^3x^3, {x, 0, nn}], x]
(* or *)
Table[Length[Select[Level[Table[Select[Compositions[n, k], Count[#, 0]==0&], {k, 1, n}], {2}], Count[#, 1]==1||Count[#, 2]==1&]], {n, 0, 10}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Geoffrey Critzer, Feb 18 2014
STATUS
approved