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.

A088054 Factorial primes: primes which are within 1 of a factorial number.

Original entry on oeis.org

2, 3, 5, 7, 23, 719, 5039, 39916801, 479001599, 87178291199, 10888869450418352160768000001, 265252859812191058636308479999999, 263130836933693530167218012159999999, 8683317618811886495518194401279999999
Offset: 1

Views

Author

Christopher M. Tomaszewski (cmt1288(AT)comcast.net), Nov 02 2003

Keywords

Comments

Conjecture: 3 is the intersection of A002981 and A002982.

Examples

			3! + 1 = 7; 7! - 1 = 5039.
39916801 is a term because 11! + 1 is prime.
		

Crossrefs

Union of A055490 and A088332.

Programs

  • Mathematica
    t = {}; Do[ If[PrimeQ[n! - 1], AppendTo[t, n! - 1]]; If[PrimeQ[n! + 1], AppendTo[t, n! + 1]], {n, 50}]; t (* Robert G. Wilson v *)
    Union[Select[Range[50]!-1, PrimeQ], Select[Range[50]!+1, PrimeQ]] (Noe)
    fp[n_] := Module[{nf=n!}, Select[{nf-1,nf+1},PrimeQ]]; Flatten[ Table[ fp[i],{i,50}]] (* Harvey P. Dale, Dec 18 2010 *)
    Select[Flatten[#+{-1,1}&/@(Range[50]!)],PrimeQ] (* Harvey P. Dale, Apr 08 2019 *)
  • Python
    from itertools import count, islice
    from sympy import isprime
    def A088054_gen(): # generator of terms
        f = 1
        for k in count(1):
            f *= k
            if isprime(f-1):
                yield f-1
            if isprime(f+1):
                yield f+1
    A088054_list = list(islice(A088054_gen(),10)) # Chai Wah Wu, Feb 18 2022

Extensions

Corrected by Paul Muljadi, Oct 11 2005
More terms from Robert G. Wilson v and T. D. Noe, Oct 12 2005