-1

For every positive integer $n$ find $\gcd(n!+1, n+1)$.

If $n+1=p$, for some prime $p$ the answer is clearly just $n+1$, due to Wilson's theorem. However, if $n+1$ is not prime, I am stuck proving that the answer is $1$.

Bill Dubuque
  • 272,048

1 Answers1

0

With $n + 1$ not being prime, then $n + 1 = ab$ for some integers $a$ and $b$ where $2 \le a \le n$ and $2 \le b \le n$. If $a \neq b$, then $a$ and $b$ are separate multipliers used in constructing $n! = \prod_{i=1}^{n}i!$, so $ab \mid n!$. This means $\gcd(n! + 1, n + 1) = 1$, as you're trying to show.

The issue to handle is if the only cases for $a$ and $b$ are that they are equal, with this only happening if they are both the same prime. In that case, if this prime $p \gt 2$, then $2p \le n$, so it's also a separate multiplier used in making $n!$ and, thus, $p^2 \mid n!$, giving the same result that the values are coprime.

Finally, if $a = b = p = 2$, then $n + 1 = 4 \implies n = 3$. In this case, you get $\gcd(3! + 1, 3 + 1) = \gcd(7,4) = 1$.

John Omielan
  • 47,976
  • $a\ne b$ both being factors of $n!$ does not imply that $ab$ is a factor of $n!$ . –  Feb 18 '20 at 20:35
  • @S.Dolan Note $a \le n$ and $b \le n$. With $a \neq b$, WLOG let $a \lt b$. Then you get something like $n! = 1 \times 2 \times \cdots \times a \times \cdots \times b \times \cdots \times n$. Thus, $a$ and $b$ are separate multipliers in constructing $n!$, so you get that $ab \mid n!$. – John Omielan Feb 18 '20 at 20:40
  • Yes, I think the phrase "i.e. factors" is misleading. –  Feb 18 '20 at 20:50
  • @S.Dolan Thanks for the feedback. I've changed my wording to hopefully make it more clear. – John Omielan Feb 18 '20 at 20:56