cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A266620 a(n) = least non-divisor of n!.

Original entry on oeis.org

2, 3, 4, 5, 7, 7, 11, 11, 11, 11, 13, 13, 17, 17, 17, 17, 19, 19, 23, 23, 23, 23, 29, 29, 29, 29, 29, 29, 31, 31, 37, 37, 37, 37, 37, 37, 41, 41, 41, 41, 43, 43, 47, 47, 47, 47, 53, 53, 53, 53, 53, 53, 59, 59, 59, 59, 59, 59, 61, 61, 67, 67, 67, 67, 67, 67, 71
Offset: 1

Views

Author

Jeffrey Shallit, Jan 01 2016

Keywords

Comments

It appears that a(n) = A151800(n) with the exception of n = 3. - Robert Israel, Jan 13 2016

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • Python
    from sympy import nextprime
    def A266620(n): return 4 if n == 3 else nextprime(n) # Chai Wah Wu, Feb 22 2023

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