OFFSET
0,6
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..619
Wikipedia, Partition of a set
FORMULA
E.g.f.: exp(x+x^5/5!).
From Seiichi Manyama, Feb 26 2022: (Start)
a(n) = n! * Sum_{k=0..floor(n/5)} (1/5!)^k * binomial(n-4*k,k)/(n-4*k)!.
a(n) = a(n-1) + binomial(n-1,4) * a(n-5) for n > 4. (End)
a(n) = hypergeom([-n/5,(1-n)/5,(2-n)/5,(3-n)/5,(4-n)/5],[],-625/24). - Karol A. Penson, Sep 14 2023.
EXAMPLE
a(6) = 7: 12345|6, 12346|5, 12356|4, 12456|3, 13456|2, 1|23456, 1|2|3|4|5|6.
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, 5]))
end:
seq(a(n), n=0..30);
# second Maple program:
seq(simplify(hypergeom([-n/5, (1-n)/5, (2-n)/5, (3-n)/5, (4-n)/5], [], -625/24)), n = 0..28); # Karol A. Penson, Sep 14 2023.
MATHEMATICA
a[n_] := a[n] = If[n == 0, 1, Sum[If[j > n, 0, a[n-j]*Binomial[n-1, j-1]], {j, {1, 5}}]];
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\5, 1/5!^k*binomial(n-4*k, k)/(n-4*k)!); \\ Seiichi Manyama, Feb 26 2022
(PARI) a(n) = if(n<5, 1, a(n-1)+binomial(n-1, 4)*a(n-5)); \\ Seiichi Manyama, Feb 26 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 27 2016
STATUS
approved