OFFSET
1,2
COMMENTS
For n > 2, a(n) is the largest value of k such that (n!+k)/(n+k) is an integer.
For n > 2, a(n) is the largest value of k such that (n!+k)/(n+k) is prime.
For n > 1, a(n) is even.
FORMULA
a(n) = n!-2n.
EXAMPLE
3!-2*3 = 0 so a(3) = 0.
4!-2*4 = 16 so a(4) = 16.
5!-2*5 = 110 so a(5) = 110.
MATHEMATICA
Table[n!-2n, {n, 30}] (* Harvey P. Dale, Oct 22 2024 *)
PROG
(Python)
import math
{print(math.factorial(n)-2*n) for n in range(1, 25)}
(PARI) for(n=1, 25, print(n!-2*n))
CROSSREFS
KEYWORD
sign
AUTHOR
Derek Orr, May 17 2014
STATUS
approved