OFFSET
1,1
COMMENTS
It appears that a(n) = A151800(n) with the exception of n = 3. - Robert Israel, Jan 13 2016
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = min_{k >= 1} prime(k)^(1 + v(n!, prime(k))) where v(m, p) is the p-adic order of m. - Robert Israel, Jan 13 2016
a(n) = prime(pi(n) + 1) except for n = 3, in which case the least non-divisor of 3! is 4, not 5. - Alonso del Arte, Sep 23 2017
EXAMPLE
For n = 4 the least non-divisor of 4! = 24 = 2^3 * 3 is 5.
For n = 5 the least non-divisor of 5! = 120 = 2^3 * 3 * 5 is 7.
MAPLE
N:= 100: # to get a(1)..a(N)
m:= 1 + numtheory:-pi(N):
Primes:= [seq(ithprime(i), i=1..m)]:
for i from 1 to m do pindex[Primes[i]]:= i od:
V:= Vector(m):
k:= 0:
for n from 1 to N do
for f in ifactors(n)[2] do
q:= pindex[f[1]];
V[q]:= V[q] + f[2];
k:= max(k, q);
od:
a[n]:= min(seq(Primes[i]^(1+V[i]), i=1..k), Primes[k+1]);
od:
seq(a[n], n=1..N); # Robert Israel, Jan 13 2016
MATHEMATICA
Table[Complement[Range[2n], Divisors[n!]][[1]], {n, 30}] (* Alonso del Arte, Sep 23 2017 *)
Table[Block[{m = n!, k = n + 1}, While[Divisible[m, k], k++]; k], {n, 67}] (* Michael De Vlieger, Sep 23 2017 *)
PROG
(Python)
from sympy import nextprime
def A266620(n): return 4 if n == 3 else nextprime(n) # Chai Wah Wu, Feb 22 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jeffrey Shallit, Jan 01 2016
STATUS
approved