OFFSET
1,3
COMMENTS
From Wilson's theorem, it follows that a(n) = 1 when n + 1 is prime, a(n) > 1 otherwise. - Alonso del Arte, Feb 25 2014
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
FORMULA
EXAMPLE
a(6) = 1 because 6! and 7 are coprime.
a(7) = 8 because 7! = 5040 and gcd(5040, 8) = 8.
a(8) = 9 because 8! = 40320 and gcd(40320, 9) = 9.
MAPLE
MATHEMATICA
Table[GCD[n!, n + 1], {n, 80}] (* Alonso del Arte, Feb 25 2014 *)
PROG
(Magma) [GCD(Factorial(n), n+1): n in [1..80]]; // Vincenzo Librandi, Mar 03 2014
(PARI) a(n)= n!/denominator(polcoeff((x+1)*exp(x+x*O(x^n)), n)); \\ Gerry Martens, Aug 12 2015
(PARI) A181569(n)=gcd(n!, n+1) \\ M. F. Hasler, Aug 16 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Oct 31 2010
STATUS
approved