OFFSET
2,1
COMMENTS
Alternately, smallest composite not dividing n!. For n > 5, twice the smallest prime greater than n. - Charles R Greathouse IV, Apr 04 2013
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 2..10000
FORMULA
a(n) = A160995(n!).
MAPLE
a := proc (n) local j: for j while gcd(j, factorial(n)) = 1 or `mod`(factorial(n), j) = 0 do end do: j end proc: seq(a(n), n = 2 .. 75); # Emeric Deutsch, Jul 23 2009
PROG
(PARI) a(n)=my(N=n!, k=n); while(N%k++==0||isprime(k), ); k \\ Charles R Greathouse IV, Apr 04 2013
(PARI) a(n)=if(n>5, 2*nextprime(n+1), (n\2+1)^2) \\ Charles R Greathouse IV, Apr 04 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 06 2009
EXTENSIONS
Extended by Emeric Deutsch, Jul 23 2009
STATUS
approved