OFFSET
0,3
COMMENTS
The best approximation can be smaller or larger than n!; that is, minimize abs(n!-r^s).
In the case of a tie, choose the smallest possible s (for example, when n=3, n!=6, we have 2^2 <= 6 <= 2^3 equally distant, choose 2^2).
EXAMPLE
a(4) = 3, since 3^3 - 3 = 24 = 4! (note 5^2-1 = 24 is not allowed because 2 < 5).
a(7) = 6, since 4^6 + 944 = 5040 = 7! and there is no closer approximation.
CROSSREFS
KEYWORD
nonn
AUTHOR
Sean A. Irvine, Mar 26 2021
STATUS
approved