Find all triples (p,a,m); p is a prime number, $a,m\in \mathbb{N}$, which satisfy: $a\leq 5p^2$ and $(p-1)!+a=p^m$.
Problem
Source: Bulgarian NMO 2017, 3rd round, p.4
Tags: algebra, number theory
21.04.2017 15:07
$Wilson's Conjecture?$
21.04.2017 15:11
Consider mod $p-1,p,p+1$
21.04.2017 15:29
For $p=2,3,5$ we can easy find all solutions $(p,a,m)=(2,1,1),(2,3,2),(2,7,3),(2,15,4),(3,1,1),(3,7,2),(3,25,3),(5,1,2),(5,101,3)$ Let $p>5$ $a-1=p^m-1-(p-1)!$ is divisible by $p(p-1)$ So $a=kp(p-1)+1 \leq5p^2 \to 0 \leq k \leq 5$ $kp(p-1)=p^m-1-(p-1)!$ $kp=p^{m-1}+...+p+1-(p-2)!$ $p-1 | (p-2)!$ because $p-1$ is even. so $k \equiv m \pmod {p-1}$ $p^m=(p-1)!+kp(p-1)+1 \leq (p-1)!+5p(p-1)+1 < 2(p-1)! <p^{p-2}$ $m< p-2 \to k=m$ $p^2-2p>mp=p^{m-1}+...+1+(p-2)!>1+2(p-2)(p-3)$ - contradiction. So answer is $(p,a,m)=(2,1,1),(2,3,2),(2,7,3),(2,15,4),(3,1,1),(3,7,2),(3,25,3),(5,1,2),(5,101,3)$
27.08.2022 22:31
Unfortunately, my solution requires checking by hand cases $p \le 13$, but posting it anyway. From Wilson's theorem, we have that $a \equiv 1 \pmod p$. Also by taking both sides of the equation $\pmod {p-1}$ we have that $a \equiv 1 \pmod {p-1}$. This means that: $$ a = kp(p-1)+1 $$from some positive integer $k$. The last crucial idea is to consider both sides of the equation $\pmod {p+1}$, because then get that $a \equiv \pm 1 \pmod {p+1}$. We split this into $2$ cases. If $a \equiv 1 \pmod {p+1}$, then $$ a =kp(p-1) +1 \equiv 2k+1 \equiv 1 \pmod {p+1} \implies k \equiv 0 \pmod {\frac{p+1}{2}} $$This means that $a=\frac{(p-1)p(p+1)}{2} l +1$ for some positive integer $l$. On the other hand, we must have: $$ 5p^2 \ge a \ge \frac{(p-1)p(p+1)}{2} l +1 \ge \frac{(p-1)p(p+1)}{2} +1 $$Rearranging the last inequality yields to: $$ 10p^2 \ge p^3 -p +1 \implies 0 \ge p^2(p-10)-p+1 $$It is easy to see that the last inequality is false for $p \ge 11$. If $a \equiv -1 \pmod {p+1}$, then: $$ a =kp(p-1)+1 \equiv 2k+1 \equiv -1 \ \implies k+1 \equiv 0 \pmod{ \frac{p-1}{2}} $$This means that $a=(\frac{p+1}{2}l-1)p(p-1)+1$ for some positive integer $l$. On the other hand, we must have: $$ 5p^2 \ge a \ge \frac{p^3-2p^2+p}{2}+1$$Rearranging the last inequality yields to: $$ 10p^2 \ge p^3-2p^2+p+1 \implies 0 \ge p^2(p-12)+p+1 $$It is easy to see that the last inequality is false for $p \ge 13$. Now it remains to check cases $p \le 13$, which is a painful but doable task.