OFFSET
0,8
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..618
Wikipedia, Partition of a set
FORMULA
E.g.f.: exp(x+x^7/7!).
From Seiichi Manyama, Feb 26 2022: (Start)
a(n) = n! * Sum_{k=0..floor(n/7)} (1/7!)^k * binomial(n-6*k,k)/(n-6*k)!.
a(n) = a(n-1) + binomial(n-1,6) * a(n-7) for n > 6. (End)
EXAMPLE
a(8) = 9: 1234567|8, 1234568|7, 1234578|6, 1234678|5, 1235678|4, 1245678|3, 1345678|2, 1|2345678, 1|2|3|4|5|6|7|8.
MAPLE
a:= proc(n) option remember; `if`(n=0, 1, add(
`if`(j>n, 0, a(n-j)*binomial(n-1, j-1)), j=[1, 7]))
end:
seq(a(n), n=0..30);
MATHEMATICA
a[n_] := a[n] = If[n == 0, 1, Sum[If[j > n, 0, a[n-j]*Binomial[n-1, j-1]], {j, {1, 7}}]];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 17 2018, translated from Maple *)
PROG
(PARI) a(n) = n!*sum(k=0, n\7, 1/7!^k*binomial(n-6*k, k)/(n-6*k)!); \\ Seiichi Manyama, Feb 26 2022
(PARI) a(n) = if(n<7, 1, a(n-1)+binomial(n-1, 6)*a(n-7)); \\ Seiichi Manyama, Feb 26 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 27 2016
STATUS
approved