OFFSET
0,4
EXAMPLE
For n = 2: the smallest value of k such that 2! + 2 + k = 4 + k is prime is 1.
MAPLE
a:= n-> (t-> nextprime(t)-t)(n!+n):
seq(a(n), n=0..80); # Alois P. Heinz, Apr 21 2021
MATHEMATICA
a[n_] := NextPrime[(m = n! + n)] - m; Array[a, 100, 0] (* Amiram Eldar, Apr 21 2021 *)
PROG
(PARI) a(n) = my(s=n!+n); nextprime(s+1) - s; \\ Michel Marcus, Apr 21 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Ventsislav D. Tsenov, Apr 21 2021
EXTENSIONS
More terms from Alois P. Heinz, Apr 21 2021
STATUS
approved