Is it known whether there is a prime $p=4k+1$ such that $k!+1$ is divisible by $p$?

(I conjectured that such primes don't exist, but couldn't prove it.)


There are no such primes $p$. Write $p=4k+1$ as $a^2+b^2$ with $a$ odd and $b$ even, and by changing the sign of $a$ if necessary suppose that $a\equiv 1 \pmod 4$. Note that $a$ is uniquely defined. Gauss showed that (see, for example, Binomial coefficients and Jacobi sums for references, and proofs of this and other similar congruences) $$ \binom{2k}{k} \equiv 2a \pmod p. $$ Also, by Wilson's theorem we know that $(2k!)^2\equiv (4k)! \equiv -1 \pmod p$. Using this, and squaring Gauss's congruence, we get $$ 4a^2 (k!)^4 \equiv -1 \pmod{p}. $$ If now $k! \equiv -1 \pmod p$ then we conclude that $4a^2 + 1\equiv 0 \pmod p$.
Since $4a^2+1$ is $1\pmod 4$ and at most $4p$, we must have $4a^2+1 =p = (2a)^2 +1^2$. But by the (essential) uniqueness of writing $p$ as a sum of two squares this forces $a=1$ (and so $p=5$). For $p=5$ we verify directly the claim.

  • $\begingroup$ Where can I find a proof of that congruence? $\endgroup$ – user50519 May 7 '14 at 21:42
  • $\begingroup$ @user50519: I added a reference to a paper that discusses this. $\endgroup$ – Lucia May 7 '14 at 21:48
  • $\begingroup$ I do not understand the end of your argument: (essential) uniqueness forces $a=1$. Example: $a=-3$ leads to $p=37$, $a=5$ to $101$. What additional information forces $a=1$? $\endgroup$ – Roland Bacher May 11 '15 at 15:15
  • $\begingroup$ @RolandBacher: Note throughout that $a^2+b^2=p$. Note that for example $37=1^2+6^2$, so you can't take $a=-3$ there. (What's being used at the end is that there's essentially only one way to write a prime $p\equiv 1\pmod 4$ as a sum of two squares.) $\endgroup$ – Lucia May 11 '15 at 15:19
  • $\begingroup$ I see. You need to remember the second sentence ($a$ odd) which I did not. Thanks. $\endgroup$ – Roland Bacher May 11 '15 at 15:27

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.