The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A193814 Least k such that n! + k + 1 is a prime. 0
0, 0, 0, 0, 4, 6, 6, 10, 22, 16, 10, 0, 28, 66, 18, 42, 22, 30, 36, 88, 28, 30, 30, 96, 130, 40, 58, 0, 66, 222, 106, 126, 78, 36, 96, 60, 130, 0, 42, 96, 52, 0, 96, 70, 46, 238, 100, 232, 52, 82, 60, 270, 52, 70, 222, 70, 148, 106, 282, 292, 270, 768, 130, 270, 66 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
LINKS
FORMULA
a(n) = 0 for n in A002981. - Michel Marcus, Oct 10 2019
EXAMPLE
a(5) = 6 because 5! + 6 + 1 = 127 is prime.
MATHEMATICA
a={}; Do[k = 0; While[ !PrimeQ[n! + k + 1], k++ ]; AppendTo[a, k], {n, 0, 70} ]; a
ld[n_]:=Module[{f=n!}, NextPrime[f]-f-1]; Array[ld, 70, 0] (* Harvey P. Dale, Jul 13 2014 *)
PROG
(PARI) a(n) = my(k=0); while (!isprime(n!+k+1), k++); k; \\ Michel Marcus, Oct 10 2019
CROSSREFS
Sequence in context: A267573 A345282 A369749 * A304409 A081732 A079033
KEYWORD
nonn
AUTHOR
Michel Lagneau, Aug 06 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 5 07:08 EDT 2024. Contains 373102 sequences. (Running on oeis4.)