login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of compositions (ordered partitions) of n into distinct parts where no part is a multiple of 5.
3

%I #11 Nov 17 2020 20:13:05

%S 1,1,1,3,3,4,9,11,11,19,44,31,61,87,117,144,279,311,389,541,640,1003,

%T 1225,2145,2493,3452,3507,5417,6671,8821,11580,17959,21043,26289,

%U 34797,41536,59637,72707,85871,110947,172472,175873,249691,327801,418779,512748

%N Number of compositions (ordered partitions) of n into distinct parts where no part is a multiple of 5.

%H Alois P. Heinz, <a href="/A332311/b332311.txt">Table of n, a(n) for n = 0..5000</a>

%H <a href="/index/Com#comp">Index entries for sequences related to compositions</a>

%e a(6) = 9 because we have [6], [4, 2], [3, 2, 1], [3, 1, 2], [2, 4], [2, 3, 1], [2, 1, 3], [1, 3, 2] and [1, 2, 3].

%p b:= proc(n, i, p) option remember; `if`(i*(i+1)/2<n, 0, `if`(n=0,

%p p!, add(b(n-i*j, i-1, p+j), j=0..min(irem(i, 5), 1, n/i))))

%p end:

%p a:= n-> b(n$2, 0):

%p seq(a(n), n=0..55); # _Alois P. Heinz_, Feb 09 2020

%t b[n_, i_, p_] := b[n, i, p] = If[i(i+1)/2 < n, 0, If[n == 0, p!, Sum[b[n - i j, i - 1, p + j], {j, 0, Min[Mod[i, 5], 1, n/i]}]]];

%t a[n_] := b[n, n, 0];

%t a /@ Range[0, 55] (* _Jean-François Alcover_, Nov 17 2020, after _Alois P. Heinz_ *)

%Y Cf. A032020, A032021, A035959, A096938, A332309, A332310.

%K nonn

%O 0,4

%A _Ilya Gutkovskiy_, Feb 09 2020