OFFSET
0,3
COMMENTS
Also number of compositions of n into parts 1, 2, 3, and 5.
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,1,1,0,-1).
FORMULA
G.f.: 1/(x^5 - x^3 - x^2 - x + 1).
a(n) = a(n-1) + a(n-2) + a(n-3) - a(n-5).
EXAMPLE
a(7)=39. These are (331),(313),(133),(322=232=223),(3211=2311),(1123=1132),(1231=1321),(3112),(2113),(1312),(1213),(3121),(2131),(31111),(13111),(11311),(11131),(11113),(2221),(2212),(2122),(1222),(22111),(21211),(12211),(12121),(11221),(11212),(11122),(12112),(21112),(21121),(211111),(121111),(112111),(111211),(111121),(111112),(1111111).
MATHEMATICA
CoefficientList[Series[1/(x^5 - x^3 - x^2 - x + 1), {x, 0, 40}], x] (* Vincenzo Librandi, May 06 2015 *)
PROG
(Magma) I:=[1, 2, 4, 7, 12]; [n le 5 select I[n] else Self(n-1)+Self(n-2)+Self(n-3)-Self(n-5): n in [1..40]]; // Vincenzo Librandi, May 06 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Neil McGrath, May 04 2015
EXTENSIONS
Corrected g.f. and more terms from Vincenzo Librandi, May 06 2015
a(0) added and g.f. adapted from Alois P. Heinz, May 08 2015
STATUS
approved