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!)
A245696 Least number k >= 0 such that (n!-k)/n is prime. 3
0, 4, 5, 42, 7, 8, 279, 130, 121, 156, 13, 322, 15, 752, 901, 1062, 779, 2020, 651, 682, 1679, 2136, 1825, 3874, 999, 1204, 2929, 930, 31, 1952, 33, 34, 6755, 4068, 4699, 3686, 39, 2920, 3403, 5502, 3397, 4796, 4905, 2438, 4183, 3792, 5047, 2950, 4947, 9308, 3551, 3186, 6985, 3416, 26277, 16066, 6431, 8220, 8479, 4402, 4473, 6464, 23335, 8382, 21239, 12988, 17319, 7210, 6887, 54072, 11899, 27602 (list; graph; refs; listen; history; text; internal format)
OFFSET
3,2
COMMENTS
a(n) < n! for all n > 2.
a(n) = n times (least m >= 0 such that (n-1)!-m is prime) = n*A033933(n-1). - Jens Kruse Andersen, Jul 30 2014 (This shows that a(n) always exists.)
LINKS
EXAMPLE
(6!-42)/6 = 113 is prime. Since 42 is the smallest number to produce a prime, a(6) = 42.
MATHEMATICA
lnk[n_]:=Module[{k=0}, While[!PrimeQ[(n!-k)/n], k++]; k]; Array[lnk, 80, 3] (* Harvey P. Dale, Jan 30 2023 *)
PROG
(PARI)
a(n)=for(k=0, 10^6, s=(n!-k)/n; if(floor(s)==s, if(ispseudoprime(s), return(k))))
n=3; while(n<100, print1(a(n), ", "); n++)
CROSSREFS
Sequence in context: A223528 A189744 A241279 * A317139 A123304 A270129
KEYWORD
nonn
AUTHOR
Derek Orr, Jul 29 2014
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 May 19 09:05 EDT 2024. Contains 372673 sequences. (Running on oeis4.)