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.
%I A088054 #43 Mar 19 2025 10:26:07 %S A088054 2,3,5,7,23,719,5039,39916801,479001599,87178291199, %T A088054 10888869450418352160768000001,265252859812191058636308479999999, %U A088054 263130836933693530167218012159999999,8683317618811886495518194401279999999 %N A088054 Factorial primes: primes which are within 1 of a factorial number. %C A088054 Conjecture: 3 is the intersection of A002981 and A002982. %H A088054 Chai Wah Wu, <a href="/A088054/b088054.txt">Table of n, a(n) for n = 1..29</a> %H A088054 C. Caldwell's The Top Twenty, <a href="https://t5k.org/top20/page.php?id=30">Factorial Primes</a>. %H A088054 Shyam Sunder Gupta, <a href="https://doi.org/10.1007/978-981-97-2465-9_16">Fascinating Factorials</a>, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 16, 411-442. %H A088054 Romeo Meštrović, <a href="http://arxiv.org/abs/1202.3670">Euclid's theorem on the infinitude of primes: a historical survey of its proofs (300 BC--2012) and another new proof</a>, arXiv preprint arXiv:1202.3670 [math.HO], 2012-2018. - From _N. J. A. Sloane_, Jun 13 2012 %H A088054 Wikipedia, <a href="http://en.wikipedia.org/wiki/Factorial_prime">Factorial prime</a>. %e A088054 3! + 1 = 7; 7! - 1 = 5039. %e A088054 39916801 is a term because 11! + 1 is prime. %t A088054 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_ *) %t A088054 Union[Select[Range[50]!-1, PrimeQ], Select[Range[50]!+1, PrimeQ]] (Noe) %t A088054 fp[n_] := Module[{nf=n!}, Select[{nf-1,nf+1},PrimeQ]]; Flatten[ Table[ fp[i],{i,50}]] (* _Harvey P. Dale_, Dec 18 2010 *) %t A088054 Select[Flatten[#+{-1,1}&/@(Range[50]!)],PrimeQ] (* _Harvey P. Dale_, Apr 08 2019 *) %o A088054 (Python) %o A088054 from itertools import count, islice %o A088054 from sympy import isprime %o A088054 def A088054_gen(): # generator of terms %o A088054 f = 1 %o A088054 for k in count(1): %o A088054 f *= k %o A088054 if isprime(f-1): %o A088054 yield f-1 %o A088054 if isprime(f+1): %o A088054 yield f+1 %o A088054 A088054_list = list(islice(A088054_gen(),10)) # _Chai Wah Wu_, Feb 18 2022 %Y A088054 Cf. A000142, A002981, A002982. %Y A088054 Union of A055490 and A088332. %K A088054 easy,nice,nonn %O A088054 1,1 %A A088054 Christopher M. Tomaszewski (cmt1288(AT)comcast.net), Nov 02 2003 %E A088054 Corrected by _Paul Muljadi_, Oct 11 2005 %E A088054 More terms from _Robert G. Wilson v_ and _T. D. Noe_, Oct 12 2005