OFFSET
0,8
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,1,1,0,0,1).
FORMULA
G.f: 1/(1-x^3-x^4-x^7).
a(n) = a(n-3) + a(n-4) + a(n-7).
EXAMPLE
a(14) = 13. The compositions (ordered partitions) of 14 into parts 3, 4 and 7 are the permutations of (7,7) (there is only one), the permutations of (7,4,3) (there are 3!=6 of these) and the permutations of (4,4,3,3) (there are 4!/2!2!=6 of these).
MAPLE
a:= proc(n) option remember; `if`(n=0, 1,
`if`(n<0, 0, add(a(n-j), j=[3, 4, 7])))
end:
seq(a(n), n=0..80); # Alois P. Heinz, Aug 21 2014
MATHEMATICA
LinearRecurrence[{0, 0, 1, 1, 0, 0, 1}, {1, 0, 0, 1, 1, 0, 1}, 60] (* Jean-François Alcover, Jan 08 2016 *)
PROG
(Magma) I:=[1, 0, 0, 1, 1, 0, 1]; [n le 7 select I[n] else Self(n-3)+Self(n-4)+Self(n-7): n in [1..60]]; // Vincenzo Librandi, Jan 08 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Neil McGrath, Aug 20 2014
STATUS
approved