OFFSET
0,4
COMMENTS
a(n) is the smallest number of elements in the image for which the number of functions f:{1,2,...,n}->{1,2,...,n} is a maximum.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = arg max_{k=0..n} Stirling2(n,k) * k! * C(n,k) for n!=2, a(2) = 1.
a(n) = arg max_{k=0..n} A090657(n,k) for n!=2, a(2) = 1.
EXAMPLE
a(3) = 2 because there are 18 functions from {1,2,3} into {1,2,3} that have two elements in their image, 3 functions have one and 6 functions that have three elements in their image.
MAPLE
T:= proc(n, k) option remember;
if k=n then n!
elif k=0 or k>n then 0
else n * (T(n-1, k-1) + k/(n-k) * T(n-1, k))
fi
end:
a:= proc(n) local i, k, m, t;
m, i:= 0, 0;
for k to n do
t:= T(n, k);
if t>m then m, i:= t, k fi
od; i
end:
seq(a(n), n=0..50); # Alois P. Heinz, Sep 08 2011
MATHEMATICA
Prepend[Flatten[Table[Flatten[First[Position[Table[StirlingS2[n, k] Binomial[n, k] k!, {k, 1, n}], Max[Table[StirlingS2[n, k] Binomial[n, k] k!, {k, 1, n}]]]]], {n, 1, 50}]], 0]
CROSSREFS
KEYWORD
nonn
AUTHOR
Geoffrey Critzer, Aug 31 2011
STATUS
approved