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 A051888 #26 Jul 02 2025 16:01:58 %S A051888 2,2,2,2,3,2,3,3,7,3,3,5,2,3,13,7,31,5,2,7,17,67,41,3,13,3,43,17,97,7, %T A051888 29,109,3,71,5,2,7,41,3,59,3,11,29,7,107,67,79,3,743,149,163,2,211,2, %U A051888 19,71,73,23,37,113,149,67,41,617,107,37,107,283,113,19,239,107,73,97,5 %N A051888 a(n) is the smallest prime p such that p*n! + 1 is prime. %C A051888 Analogous to or subset of A051686; generalization of A005384. %C A051888 The PFGW program has been used to certify all the primes corresponding to the terms up to a(1000), using a deterministic test which exploits the factorization of a(n) - 1. - _Giovanni Resta_, May 30 2018 %H A051888 Giovanni Resta, <a href="/A051888/b051888.txt">Table of n, a(n) for n = 0..1000</a> %F A051888 a(n) = (A051901(n)-1)/n!. - _Amiram Eldar_, Feb 25 2025 %t A051888 Do[k = 1; While[ !PrimeQ[ Prime[k]*n! + 1], k++ ]; Print[ Prime[k]], {n, 1, 75} ] %t A051888 spp[n_]:=Module[{p=2,nf=n!},While[!PrimeQ[p*nf+1],p=NextPrime[p]];p]; Array[ spp,80,0] (* _Harvey P. Dale_, May 17 2019 *) %o A051888 (PARI) a(n) = {my(p=2); while (!isprime(p*n! + 1), p = nextprime(p+1)); p;} \\ _Michel Marcus_, May 28 2018 %Y A051888 Cf. A005384, A051686, A051886, A051887, A051901, A064983. %K A051888 nonn %O A051888 0,1 %A A051888 _Labos Elemer_, Dec 15 1999 %E A051888 More terms from _James Sellers_, Dec 16 1999