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$.
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$.
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$.