login
Greatest common divisor of n! and n+1.
4

%I #27 Sep 08 2022 08:45:54

%S 1,1,2,1,6,1,8,9,10,1,12,1,14,15,16,1,18,1,20,21,22,1,24,25,26,27,28,

%T 1,30,1,32,33,34,35,36,1,38,39,40,1,42,1,44,45,46,1,48,49,50,51,52,1,

%U 54,55,56,57,58,1,60,1,62,63,64,65,66,1,68,69,70,1,72,1,74,75,76,77,78,1

%N Greatest common divisor of n! and n+1.

%C 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

%H Vincenzo Librandi, <a href="/A181569/b181569.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A050873(A000142(n), n + 1);

%F a(A006093(n)) = 1;

%F for n > 3: a(n) = (n + 1) / (n*A010051(n+1) + 1).

%F a(n) = (n+1)/A014973(n+1). - _Michel Marcus_, Aug 14 2015

%e a(6) = 1 because 6! and 7 are coprime.

%e a(7) = 8 because 7! = 5040 and gcd(5040, 8) = 8.

%e a(8) = 9 because 8! = 40320 and gcd(40320, 9) = 9.

%p A181569:=n->gcd(n!,n+1): seq(A181569(n), n=1..100); # _Wesley Ivan Hurt_, Aug 13 2015

%t Table[GCD[n!, n + 1], {n, 80}] (* _Alonso del Arte_, Feb 25 2014 *)

%o (Magma) [GCD(Factorial(n), n+1): n in [1..80]]; // _Vincenzo Librandi_, Mar 03 2014

%o (PARI) a(n)= n!/denominator(polcoeff((x+1)*exp(x+x*O(x^n)), n)); \\ _Gerry Martens_, Aug 12 2015

%o (PARI) A181569(n)=gcd(n!,n+1) \\ _M. F. Hasler_, Aug 16 2015

%Y Cf. A000142, A006093, A010051, A050873.

%Y Cf. A088140, A135683.

%K nonn,easy

%O 1,3

%A _Reinhard Zumkeller_, Oct 31 2010