The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A301427 Least nonnegative integer k such that n! - n - k is prime. 1
 0, 1, 2, 5, 10, 23, 4, 1, 2, 1, 10, 3, 32, 37, 42, 23, 82, 11, 10, 51, 66, 49, 124, 11, 16, 73, 2, 49, 30, 131, 14, 159, 78, 91, 60, 41, 34, 43, 90, 37, 66, 65, 8, 43, 32, 55, 10, 47, 128, 15, 6, 73, 6, 405, 220, 51, 78, 79, 10, 9, 38, 295, 62, 251, 124, 183, 34, 27, 680, 91, 300 (list; graph; refs; listen; history; text; internal format)
 OFFSET 3,3 COMMENTS The (n-1) consecutive numbers n!-n, ... , n!-2 (for n > 3) are not prime. LINKS Seiichi Manyama, Table of n, a(n) for n = 3..500 FORMULA a(n) = A037155(n) - n. EXAMPLE a(3)=0 because 3! - 3 - 0 =   3 is prime. a(4)=1 because 4! - 4 - 1 =  19 is prime and 20 is not. a(5)=2 because 5! - 5 - 2 = 113 is prime and 114 and 115 are not prime. MAPLE f:= proc(n) local r; r:= n!-n;   r - prevprime(r) end proc: f(3):= 0: seq(f(i), i=3..100); # Robert Israel, Mar 23 2018 MATHEMATICA a[n_] := n! - NextPrime[n! - 1, -1] - n; a /@ Range[3, 100] (* Jean-François Alcover, Oct 26 2020 *) PROG (PARI) a(n) = apply(x->(x-precprime(x)), n!-n); vector(99, n, a(n+2)) \\ Altug Alkan, Mar 21 2018 CROSSREFS Cf. A037155, A073443, A090786. Sequence in context: A046745 A198950 A015902 * A300275 A226455 A284139 Adjacent sequences:  A301424 A301425 A301426 * A301428 A301429 A301430 KEYWORD nonn AUTHOR Seiichi Manyama, Mar 21 2018 STATUS approved

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

Last modified July 23 12:19 EDT 2021. Contains 346259 sequences. (Running on oeis4.)