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”).

A364344
Number of endofunctions on [n] such that the number of elements that are mapped to i is a multiple or a divisor of i.
4
1, 1, 4, 20, 177, 1462, 21919, 254802, 4816788, 82401465, 1929926410, 35256890748, 1152938630784, 24977973856643, 823036511854847, 24332827884557037, 954801492779273665, 27023410818058291822, 1309814517293654535339, 41375530521928893861920
OFFSET
0,3
LINKS
EXAMPLE
a(0) = 1: ().
a(1) = 1: (1).
a(2) = 2: (11), (12), (21), (22).
a(3) = 20 (111), (112), (113), (121), (122), (123), (131), (132), (211), (212), (213), (221), (223), (231), (232), (311), (312), (321), (322), (333).
MAPLE
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
add(b(n-i*j, i-1)*binomial(n, i*j), j=0..n/i)+add(
`if`(d>n or d=i, 0, b(n-d, i-1)*binomial(n, d)),
d=numtheory[divisors](i))))
end:
a:= n-> b(n$2):
seq(a(n), n=0..19);
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i<1, 0, Sum[b[n - i*j, i - 1]* Binomial[n, i*j], {j, 0, n/i}]+Sum[If[d>n || d == i, 0, b[n - d, i - 1]* Binomial[n, d]], {d, Divisors[i]}]]];
a[n_] := b[n, n];
Table[a[n], {n, 0, 19}] (* Jean-François Alcover, Oct 27 2023, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 19 2023
STATUS
approved