A245368 Compositions of n into parts 3, 4 and 7.
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
Examples
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).
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).
Programs
-
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
-
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 *)
Formula
G.f: 1/(1-x^3-x^4-x^7).
a(n) = a(n-3) + a(n-4) + a(n-7).