OFFSET
0,3
COMMENTS
Also, number of sequences composed of 1's and 2's summing to n which does not contain "...22...11..." where "..." is any (potentially empty) string. So for example, a[7] = 19 because there are 21 sequences without the restriction, but we must exclude 12211 and 22111. The bijection is to interchange "3" with "21." Also, satisfies the recursion a(n)=a(n-1)+a(n-2)+a(n-3)-a(n-4)-a(n-5)-a(n-6). - Joel B. Lewis, Nov 06 2006
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,1,-1,-1,-1).
FORMULA
Sum( binomial(n-b-2c, c), (b = 0..floor[(n -3c)/2]), (c = 0..floor[n/3]) )
G.f.: A(x) = (1 - x^3) / ((1 - x - x^3)(1 - x^2 - x^3)) = (1 - x^3) / (1 - x - x^2 - x^3 + x^4 + x^5 + x^6)
a(n) = a(n-1) +a(n-2) +a(n-3) -a(n-4) -a(n-5) -a(n-6). - Joel B. Lewis, Nov 06 2006
EXAMPLE
a(4) = 5 because we can write 4 = 1+1+1+1 = 1+1+2 = 2+2 = 1+3 = 3+1
MATHEMATICA
Sum[Sum[Binomial[n-b-2c, c], {b, 0, Floor[(n-3c)/2]}], {c, 0, Floor[n/3]}]
CoefficientList[Series[(1 - x^3)/((1 - x - x^3)*(1 - x^2 - x^3)), {x, 0, 50}], x] (* G. C. Greubel, Apr 29 2017 *)
PROG
(PARI) x='x+O('x^50); Vec((1 - x^3)/((1 - x - x^3)*(1 - x^2 - x^3))) \\ G. C. Greubel, Apr 29 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Joel B. Lewis, Nov 03 2006, Nov 11 2006
STATUS
approved