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.

A033933 Least nonnegative m such that n! - m is prime.

Original entry on oeis.org

0, 1, 1, 7, 1, 1, 31, 13, 11, 13, 1, 23, 1, 47, 53, 59, 41, 101, 31, 31, 73, 89, 73, 149, 37, 43, 101, 31, 1, 61, 1, 1, 193, 113, 127, 97, 1, 73, 83, 131, 79, 109, 109, 53, 89, 79, 103, 59, 97, 179, 67, 59, 127, 61, 461, 277, 109, 137, 139, 71, 71, 101, 359, 127, 317, 191, 251, 103, 97, 751, 163, 373, 199, 167, 157, 491, 317
Offset: 2

Views

Author

Keywords

Comments

Conjecture: for n >= 3, a(n) is 1 or a prime. - Amarnath Murthy, Mar 19 2002
a(n) is not divisible by any prime <= n. If a(n) > 1 is composite, then a(n) > n^2. There are no entries up to n = 2000 with a(n) > n^2, and there may be none. - Robert Israel, Jul 20 2014

Crossrefs

Programs

  • Maple
    0, seq(n! - prevprime(n!), n=3..100); # Robert Israel, Jul 15 2014
  • Mathematica
    p[n_] := Module[{nf = n!}, nf - NextPrime[nf, -1]]; Join[{0}, Table[p[n], {n, 3, 70}]] (* Harvey P. Dale, Jul 07 2012 *)
  • PARI
    for(n=2,70, k=0; while(!isprime(n!-k), k++); print1(k,","))
    
  • PARI
    vector(66, t, my(n=t+1, f=n!); f-precprime(f)) \\ Joerg Arndt, Jul 19 2014
    
  • Sage
    def A033933(n):
        if n < 3: return 0
        f = factorial(n)
        return f - previous_prime(f)
    [A033933(n) for n in (2..78)] # Peter Luschny, Jul 20 2014

Extensions

More terms from Jud McCranie
a(21) onwards from Wouter Meeussen
Corrected by Rick L. Shepherd, Nov 06 2002