OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..587
Wikipedia, Partition of a set
FORMULA
a(n) = n! * [x^n] exp(Sum_{d|n} x^d/d!) for n>0, a(0) = 1.
a(n) = A275422(n,n).
a(p) = 2 for p prime.
EXAMPLE
a(4) = 11: 1234, 12|34, 12|3|4, 13|24, 13|2|4, 14|23, 1|23|4, 14|2|3, 1|24|3, 1|2|34, 1|2|3|4.
a(5) = 2: 12345, 1|2|3|4|5.
MAPLE
A:= proc(n, k) option remember; `if`(n=0, 1, add(
`if`(j>n, 0, A(n-j, k)*binomial(n-1, j-1)), j=
`if`(k=0, 1..n, numtheory[divisors](k))))
end:
a:= n-> A(n$2):
seq(a(n), n=0..30);
MATHEMATICA
A[n_, k_] := A[n, k] = If[n == 0, 1, Sum[If[j > n, 0, A[n - j, k]* Binomial[n - 1, j - 1]], {j, If[k == 0, Range[n], Divisors[k]]}]];
a[n_] := A[n, n];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 17 2018, translated from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 27 2016
STATUS
approved