login
A245368
Compositions of n into parts 3, 4 and 7.
2
1, 0, 0, 1, 1, 0, 1, 3, 1, 1, 5, 5, 2, 7, 13, 8, 10, 25, 26, 20, 42, 64, 54, 72, 131, 144, 146, 245, 339, 344, 463, 715, 827, 953, 1423, 1881, 2124, 2839, 4019, 4832, 5916, 8281, 10732, 12872, 17036, 23032, 28436, 35824, 48349, 62200, 77132, 101209, 133581
OFFSET
0,8
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
Sequence in context: A158418 A124925 A073145 * A354971 A239331 A145033
KEYWORD
nonn,easy
AUTHOR
David Neil McGrath, Aug 20 2014
STATUS
approved