OFFSET
2,1
EXAMPLE
2! = 2
3! = 2 * 3
4! = 2^3 * 3
5! = 2 * 3 * 4 * 5
6! = 3^2 * 4^2 * 5
7! = 4 * 5 * 6^2 * 7
8! = 3 * 4^3 * 5 * 6 * 7
9! = 3 * 4^2 * 5 * 6^3 * 7
10! = 4^2 * 5^2 * 6^4 * 7
11! = 7 * 8^2 * 9^2 * 10^2 * 11
12! = 6^5 * 7 * 8 * 10^2 * 11
13! = 7 * 8^2 * 9^2 * 10^2 * 11 * 12 * 13
14! = 7^2 * 8 * 9 * 10^2 * 11 * 12^3 * 13
15! = 7^2 * 9 * 10^3 * 11 * 12^4 * 13
16! = 7^2 * 10^3 * 11 * 12^6 * 13
17! = 10 * 11 * 12^4 * 13 * 14^2 * 15^2 * 16 * 17
PROG
(PARI) f(n, mn, mx)=if(n%mn, return(0)); n/=mn; if(n==1, return(1)); for(k=mn, mx, if(f(n, k, mx), return(1))); 0
a(n)=if(n<6, return(2)); my(p=precprime(n), q=nextprime(p/2), N=n!); forprime(r=q+1, p-1, N/=r^valuation(N, r)); forstep(k=q, 3, -1, if(f(N, k, p), return(k)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Charles R Greathouse IV, Dec 10 2015
STATUS
approved