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.

Showing 1-4 of 4 results.

A033932 Least positive m such that n! + m is prime.

Original entry on oeis.org

1, 1, 1, 1, 5, 7, 7, 11, 23, 17, 11, 1, 29, 67, 19, 43, 23, 31, 37, 89, 29, 31, 31, 97, 131, 41, 59, 1, 67, 223, 107, 127, 79, 37, 97, 61, 131, 1, 43, 97, 53, 1, 97, 71, 47, 239, 101, 233, 53, 83, 61, 271, 53, 71, 223, 71, 149, 107, 283, 293, 271, 769, 131, 271
Offset: 0

Views

Author

Keywords

Comments

Conjecture: No term is a composite number. a(n) is a prime > 3*prime(k), where k is such that prime(k) < n <= prime(k+1). - Amarnath Murthy, Apr 07 2004
Terms after n = 2000 in the b-file correspond to Fermat and Lucas PRP. - Phillip Poplin, Oct 12 2019

Crossrefs

Programs

  • Maple
    a:= n-> (f-> nextprime(f)-f)(n!):
    seq(a(n), n=0..70);  # Alois P. Heinz, Feb 22 2023
  • Mathematica
    a[n_] := (an = 1; While[ !PrimeQ[n! + an], an++]; an); Table[a[n], {n, 0, 63}] (* Jean-François Alcover, Dec 05 2012 *)
    NextPrime[#]-#&/@(Range[0,70]!) (* Harvey P. Dale, May 18 2014 *)
  • PARI
    for(n=0,70, k=1; while(!isprime(n!+k), k++); print1(k,","))
    
  • PARI
    a(n) = nextprime(n!+1) - n!; \\ Michel Marcus, Dec 25 2020
    
  • Python
    from sympy import factorial, nextprime
    def a(n): fn = factorial(n); return nextprime(fn) - fn
    print([a(n) for n in range(64)]) # Michael S. Branicky, May 22 2022

Formula

a(n) = A151800(n!) - n!. - Max Alekseyev, Jul 23 2014

Extensions

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

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

A053714 Smallest (in magnitude) nonzero number m such that n!+m is prime.

Original entry on oeis.org

1, 1, 1, -1, 7, -1, -1, 23, -13, 11, 1, -1, -23, -1, 43, 23, 31, 37, 89, 29, 31, 31, -89, -73, 41, -37, 1, 67, -31, -1, -61, -1, -1, 97, 61, -127, 1, -1, -73, 53, 1, -79, 71, 47, -53, -89, -79, 53, -59, 61, -179, 53, -59, -127, -61, 149, 107, -109, -137, -139, -71, -71, -101, 67, -127, 283, 73, 83, -103, -97, -751, 101
Offset: 1

Views

Author

Labos Elemer, Feb 10 2000

Keywords

Comments

a(n) is the defined, nonzero (thus excluding a(1) and a(2) of A033933) minimum of A033932(n) and A033933(n) multiplied by -1 if that minimum is not A033932(n). If n!+m and n!-m are equidistant primes (A053709), we have (arbitrarily) chosen positive m.

Examples

			For n=4, the possible m are -1 (24-1) and +5 (24+5). The former is closer to 4! so a(4) is -1.
For n=5, the possible m are -7 (120-7) and +7 (120+7). Being equidistant to 5!, a(5) is +7.
		

Crossrefs

Cf. A006990, A037151, A033932, A033933, A053709, A056752 (unsigned version with a different second term).

Extensions

Edited by Hans Havermann, Jul 23 2014

A088412 A088258 indexed by A000142.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 11, 12, 14, 27, 30, 32, 33, 37, 38, 41, 73, 77, 94, 116, 154, 166, 320, 324, 340, 379, 399, 427, 469, 546, 872, 974, 1477, 1963, 3507, 3610, 6380, 6917, 21480, 26951, 34790, 94550, 103040, 110059, 147855, 150209, 208003
Offset: 1

Views

Author

Ray Chandler, Sep 29 2003

Keywords

Comments

Union of A002981 and A002982, except 0. - Andrey Zabolotskiy, Aug 25 2016
Terms correspond to indices m where A056752(m)=1, excepting m=2. - Bill McEachen, May 20 2025

Crossrefs

Programs

  • Maple
    select(t -> isprime(t!-1) or isprime(t!+1), [$1..600]); # Robert Israel, Aug 25 2016
  • Mathematica
    Select[Range[10^3], Or @@ PrimeQ@ {# - 1, # + 1} &[#!] &] (* Michael De Vlieger, Aug 25 2016 *)

Formula

a(n) is such positive k that A088258(n) = A000142(k).

Extensions

Values 320 to 546 extracted from Mishima's table by R. J. Mathar, Mar 05 2010
More terms and correction of the initial term from Andrey Zabolotskiy, Aug 25 2016
Showing 1-4 of 4 results.