login
Compositions of n into parts 3, 4 and 7.
2

%I #16 Sep 08 2022 08:46:08

%S 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,

%T 245,339,344,463,715,827,953,1423,1881,2124,2839,4019,4832,5916,8281,

%U 10732,12872,17036,23032,28436,35824,48349,62200,77132,101209,133581

%N Compositions of n into parts 3, 4 and 7.

%H Alois P. Heinz, <a href="/A245368/b245368.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,1,1,0,0,1).

%F G.f: 1/(1-x^3-x^4-x^7).

%F a(n) = a(n-3) + a(n-4) + a(n-7).

%e 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).

%p a:= proc(n) option remember; `if`(n=0, 1,

%p `if`(n<0, 0, add(a(n-j), j=[3, 4, 7])))

%p end:

%p seq(a(n), n=0..80); # _Alois P. Heinz_, Aug 21 2014

%t LinearRecurrence[{0, 0, 1, 1, 0, 0, 1}, {1, 0, 0, 1, 1, 0, 1}, 60] (* _Jean-François Alcover_, Jan 08 2016 *)

%o (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

%Y Cf. A017818, A079956.

%K nonn,easy

%O 0,8

%A _David Neil McGrath_, Aug 20 2014