Find all pairs $(a,b)$ of positive integers such that $a!+b$ and $b!+a$ are both powers of $5$. Nikola Velov, North Macedonia
Problem
Source: JBMO 2023 Problem 1
Tags: number theory, factorial
26.06.2023 10:36
WLOG assume that $a \geq b$. We split into two cases. Case 1: $a=b$. Then, $a!+a=5^k$ with $k \geq 1$. If $k=1$ then obiously $(a,b)=(5,5)$ works. If $k \geq 2$, then $(a-1)!+1 \equiv 1 \pmod 5$, and since $5^k=a!+a=a((a-1)!+1),$ we must have $(a-1)!+1=1,$ a contradiction. Case 2: $a>b$. Then, $a=b+s$ with $s \geq 1$. Let $a!+b=5^k$ with $k \geq 1$. Therefore, $b((b-1)! \cdot (b+1) \cdots (b+s)+1)=5^k$. Thus, $b=5^\ell$ with $\ell \geq 0$, and if $b-1 \geq 5$ then $(b-1)! \cdot (b+1) \cdots (b+s)+1 \equiv 1 \pmod 5,$ a contradiction. Moreover, if $s \geq 5$, then $5 \mid (b+1) \cdots (b+5) \mid (b+1) \cdots (b+s),$ and so $(b+1) \cdots (b+s)+1 \equiv 1 \pmod 5,$ a contradiction. Therefore, $b \leq 5$ and $s \leq 4$. Taking all cases, we obtain $(b,s)=(1,3),$ that is $(a,b)=(4,1)$. To sum up, we obtain the solutions $(a,b)=(5,5), (4,1)$ and $(1,4)$.
26.06.2023 14:20
Orestis_Lignos wrote: WLOG assume that $a \geq b$. We split into two cases. Case 1: $a=b$. Then, $a!+a=5^k$ with $k \geq 1$. If $k=1$ then obiously $(a,b)=(5,5)$ works. If $k \geq 2$, then $(a-1)!+1 \equiv 1 \pmod 5$, and since $5^k=a!+a=a((a-1)!+1),$ we must have $(a-1)!+1=1,$ a contradiction. Case 2: $a>b$. Then, $a=b+s$ with $s \geq 1$. Let $a!+b=5^k$ with $k \geq 1$. Therefore, $b((b-1)! \cdot (b+1) \cdots (b+s)+1)=5^k$. Thus, $b=5^\ell$ with $\ell \geq 0$, and if $b-1 \geq 5$ then $(b-1)! \cdot (b+1) \cdots (b+s)+1 \equiv 1 \pmod 5,$ a contradiction. Moreover, if $s \geq 5$, then $5 \mid (b+1) \cdots (b+5) \mid (b+1) \cdots (b+s),$ and so $(b+1) \cdots (b+s)+1 \equiv 1 \pmod 5,$ a contradiction. Therefore, $b \leq 5$ and $s \leq 4$. Taking all cases, we obtain $(b,s)=(1,3),$ that is $(a,b)=(4,1)$. To sum up, we obtain the solutions $(a,b)=(5,5), (4,1)$ and $(1,4)$. ohh Same solution
29.06.2023 17:59
We claim that the only solutions are $(1,4),(4,1)$, and $(5,5)$. Suppose that we have integers $a$ and $b$ such that $a!+b=5^r$ and $b!+a=5^t$ for some $r,t\geq 1$. If $a\geq 5$, we have that $5\mid a!$. Since $5\mid a!$ and $5\mid 5^r$, we have $5\mid b$. This means that $b\geq 5$. By the same argument, we have $5\mid a$. So $a=5x$ and $b=5y$ for some positive integers $x,y$. Suppose that $x>1$. Then $v_5(a!)>1$. Since $a!+b=5^r$, we have $v_5(b)=v_5(a!).$ However, as $v_5(b)>1$ we have that $v_5(b!)>v_5(b)$. Hence $v_5(b!+a)=\min\{v_5(b!),v_5(a)\}=v_5(a)$, but this is clearly a contradiction as $t>v_5(a)$. We thus have that $x=1$. By symmetry we get that $y=1$ which gives us the pair $(a,b)=(5,5)$ which is a solution. Now it remains to consider $a<5$. This implies $b<5$ due to the reasoning above. We check the following cases: \begin{itemize} \item If $a=1$, then $1!+b\equiv 0\pmod 5$ so $b=4$. This pair is a solution. \item If $a=2$, then $2!+b\equiv 0\pmod 5$ so $b=3$. This pair is not a solution. \item If $a=3$, then $3!+b\equiv 0\pmod 5$ so $b=4$. This pair is not a solution. \item If $a=4$, then $4!+b\equiv 0\pmod 5$ so $b=1$. This pair is a solution. \end{itemize}
01.07.2023 17:37
The following solution was proposed together with the problem: The condition is symmetric so we can assume that $b \leq a$. The first case is when $a=b$. In this case, $a!+a=5^m$ for some positive integer $m$. We can rewrite this as $a \cdot \left ( (a-1)!+1 \right)=5^{m}$. This means that $a=5^{k}$ for some integer $k \geq 0$. It is clear that $k$ cannot be $0$. If $k \geq 2$, then $(a-1)!+1 = 5^{l}$ for some $l \geq 1$, but $a-1=5^{k}-1 > 5$, so $5|(a-1)!$, which is not possible because $5|(a-1)!+1$. This means that $k=1$ and $a=5$. In this case, $5!+5 = 125$, which gives us the solution $(5,5)$. Let us now assume that $1 \leq b<a$. Let us first assume that $b=1$. Then $a+1=5^x$ and $a!+1=5^y$ for integers $x,y \geq 1$. If $x \geq 2$, then $a=5^x-1 \geq 5^2-1>5$, so $5|a!$. However, $5|5^y=a!+1$, which leads to a contradiction. We conclude that $x=1$ and $a=4$. From here $a!+b=25$ and $b!+a=5$, so we get two more solutions: $(1,4)$ and $(4,1)$. Now we focus on the case $1 < b < a$. Then we have $a!+b = 5^x$ for $x \geq 2$, so $b \cdot \left ( \frac{a!}{b}+1 \right ) = 5^x$, where $b|a!$ because $a>b$. Because $b|5^x$ and $b>1$, we have $b=5^z$ for $z \geq 1$. If $z \geq 2$, then $5<b<a$, so $5|a!$, which means that $\frac{a!}{b}+1$ cannot be a power of $5$. We conclude that $z=1$ and $b=5$. From here $5!+a$ is a power of $5$, so $5|a$, but $a>b=5$, which gives us $a \geq 10$. However, this would mean that $25|a!$, $5|b$ and $25 \nmid b$, which is not possible, because $a!+b=5^x$ and $25|5^x$. We conclude that the only solutions are $(1,4)$, $(4,1)$ and $(5,5)$.
02.07.2023 17:29
If $a<5$, it is obvious that $5$ does not divide $a$, so $5$ does not divide $b!$. This implies that $b<5$. By checking all possible values, we find that $(a,b)=(1,4)$ satisfies the condition. If $a\geq 5$, it is obvious that $5$ divides $a!$, which means $5$ divides $b$. In turn, this implies that $5$ divides $b!$, and therefore $5$ divides $a$. When $a=b=5$, the condition is satisfied. If $a>5$, we will prove by induction that for any $k\in \mathbb{N}^*$, $5^k$ divides $a$. (i) From $a>5$ and $5|a$, we have $a\geq 10$. (ii) If there exists a positive integer $m>1$ such that $5^m|a$, then $5^{m+1}|a!$. Since $a!+b$ is a power of $5$, we have $5^{m+1}|b$. Hence, $5^{m+1}|b!$. Furthermore, since $b!+a$ is a power of $5$, we have $5^{m+1}|a$. Based on (i) and (ii), we can conclude that for any $k\in \mathbb{N}^*$, $5^k|a$. However, this is clearly impossible. In conclusion, $(a,b)$ can only be $(1,4)$ or $(4,1)$ or $(5,5)$.
06.07.2023 02:35
WLOG $a\geq b$ We have that $a!+b=5^t$ and $b!+a=5^s$ Let's assume that $a\geq10$ Let $v_5(a!)=x>1$ From $a!+b=5^t$ we have that $v_5(b)=x\implies b\geq5^x$ Now note that $b!=1\cdot2\cdot3\cdot\cdot\cdot\cdot\cdot b$ which has $\frac{b}{5}$ numbers divisible by 5. Thus $v_5(b!)\geq\frac{b}{5}\geq\frac{5^x}{5}=5^{x-1}$ From $b!+a=5^s$ and $v_5(b!)\geq5^{x-1}$ we get that $v_5(a)\geq5^{x-1}$ $5^{x-1}>x$ for $x>1$ which is a contradiction with $v_5(a!)\geq v_5(a)$ Hence $a<10$ When we check the remaining possibilities we conclude that $(a,b)=(1,4)$ or $(4,1)$ or $(5,5)$
02.08.2023 15:10
mathmax12 wanted me to share his solution: WLOG $a\ge b$, now we have $2$ cases: If $a=b$: So $a!+a=5^n$, where $n \ge 1.$ When $n=3$, we have that $a=b=5$, works. If $n \ge 3$ we have contradiction. If $a>b$: Let $a=b+x$, so $s \ge 1$, we also have $a!+b=5^k$, we have $b\le 5$, and $s \le 4$, otherwise contradiction. If we take all cases, we get that, $(4,1)$ works, so the solutions are $(a,b)=(5,5), (4,1) and (1,4).$
13.09.2023 15:14
After the competition one of the Bulgarian contestants proposed looking at triples $(a,b,p)$, where $p$ is prime, such that $a! + b$ and $b!+a$ are both powers of $p$. I just solved this now, here is a solution. (This would have been a great Problem 4 (or maybe 3 if one wants the problem set to be extreme) in my opinion, shame we did not think about it in time.) Answer. $(a,b,p) = (2, 2, 2), (3, 3, 3), (5, 5, 5)$, $(1, 1, 2)$, $(2, 1, 3)$, $(1, 2, 3)$, $(4, 1, 5)$, $(1, 4, 5)$ Without loss of generality treat $a\geq b$. Suppose firstly that $a \geq 2p$. In \[a! + b = b \cdot (1 \cdot 2 \cdots (b-1) \cdot b+1 \cdots (a-1) \cdot a + 1)\]both multipliers on the right must be powers of $p$. The second multiplier is greater than $1$, while $1 \cdot 2 \cdots (b-1) \cdot b+1 \cdots (a-1) \cdot a$ is divisible by $p$, since for $b\neq p$ we have $p$ as a multiplier, while for $b=p$ we have $2p$ as a multiplier, hence $(1 \cdot 2 \cdots (b-1) \cdot b+1 \cdots (a-1) \cdot a + 1$ is not divisible by $p$, which is impossible. Hence $b \leq a \leq 2p-1$ and since $b$ is a power of $p$, we must have $b=p$ or $b=1$. Let $b=p$. Since $b!+a$ is a power of $p$, we must have that $a$ is divisible by $p$ and now $a\leq 2p-1$ implies $a=p$. In this case $b! + a = p((p-1)! + 1)$ and so it remains to see for which $p$ there is $k$ with $(p-1)! + 1 = p^k$. For $p=2$ we have $k=1$, for $p=3$ we have $k=1$, for $p=5$ we have $k=2$ and we now show that no $p\geq 7$ works. Divide by $p-1$ in $(p-1)! = p^k - 1$ to obtain \[ (p-2)! = p^{k-1} + p^{k-2} + \cdots + p + 1. \]Consider the latter modulo $p-1$. For $p\geq 7$ the left-hand side contains the different multipliers $2$ and $\frac{p-1}{2}$ and so it is divisible by $p-1$. Each summand on the right gives remainder $1$ when divided by $p-1$, so the right-hand side is congruent to $k$. Hence $k$ must be divisible by $p-1$, but then $k\geq p-1$ and $(p-2)! > p^k \geq p^{p-1}$, which is impossible. Let $b=1$. We want $a+1 = p^m$ for some $m\geq 1$, i.e. $a = p^m-1$, as well as $a! + 1 = p^n$ for some $n\geq 1$, i.e. $(p^m-1)! = p^n - 1$. If $m\geq 2$, then the left-hand side is divisible by $p$, while the right-hand side is not, contradiction. For $m=1$ we get $(p-1)! = p^n - 1$, thus as in the previous case we obtain only $p=2$ (with $a=1$), $p=3$ (with $a=2$) and $p=5$ (with $a=4$).
20.01.2024 08:23
If $a=b$, then $a((a-1)!+1)$ is a power of $5$. In particular, $a$ and $(a-1)!+1$ are powers of $5$, and if $a\geq 6$ the latter is equivalent to $1$ mod $5$. Check $1,2,3,4,5$ to get $(5,5)$. Otherwise WLOG $a>b$. First, if $b=1$ then $a!+1$ and $1+a$ are powers of $5$. In particular, $a< 5$ since otherwise $a!+1\equiv 1 \pmod 5$. Else, $b>1$ so $b \mid a!+b$, implying $5\mid b$. Moreover, \[5^x=a!+b=b\left(\frac{a!}{b}+1\right)\]Then, if $a\geq 10$, we must have $\frac{a!}{b}+1 \equiv 1 \pmod 5$ so therefore $b=5$. A finite case check yields no solutions. Therefore, $(a,b)=(4,1),(1,4),(5,5)$
15.03.2024 13:42
Here is my solution sketch... Case 1:Let $a,b >5$ It is easy to see that both $a$ and $b$ must be powers of $5$. Now, WLOG, let $a \geq b$, $a!+b= b(\frac{a!}{b}+1)$ We see that $\frac{a!}{b}+1$ is $1$ modulo $5$, so this choice of $(a,b)$ fails. Case 2:Let $a>5$ and $b<5$ We see that $b$ must be odd. So $b=1$ or $b=3$. However, both these choices of $b$ fail as $a!+b \equiv b \pmod 5$. Thus we can't choose such pairs of $(a,b)$ either. Case 3: Let $a,b<5$. Note that $(a,b)=(5,5)$ works. In the third case, if $a,b\geq 2$, it is easy to conclude that both $a$ and $b$ must be odd. However, $(3,3)$ does not work. So both $a$ or $b$ must be $1$, Now checking the last few cases left we see that $(a,b)=(4,1);(1,4)$ work. We thus have gotten three such pairs of $a$ and $b$.
19.03.2024 16:52
Notice that if $x\in\mathbb{Z^*_+}$, then $x!$ ends in 1 (1!), 2 (2!), 6(3!), 4(4!), or 0 ($x\geq 5$) Let $\begin{cases} a!+b= 5^x\\ b!+a= 5^y \end{cases}$ Where $x,y\in\mathbb{Z^*_+}$ If $a=1\implies b!+1= 5^y\implies b!\equiv 4 \mbox{ (mod 10)}$ So, $b= 4$ (if $b\geq 5\implies b!\equiv 0 \mbox{ (mod 10)})$ $\therefore \boxed{(a,b)= (1,4)}$ is solution ($1!+4= 5= 5^1$) If $a=2\implies b!+2= 5^y\implies b!\equiv 3\mbox{ (mod 10)}$, which is impossible. If $a=3\implies b!+3= 5^y\implies b!\equiv 2 \mbox{ (mod 10)}\implies b=2$. But, we also need that $a!+b$ is a power of five, so $3!+2= 8$ is a power of 5, contradiction! If $a= 4$, we get the solution $\boxed{(a,b)= (4,1)}$ If $a=5\implies 5!+b= 5^x\implies b!\equiv 5 \mbox{ (mod 100)}$. Also, we know that $b!+5=5^y\implies b!\equiv 20 \mbox{ (mod 100)}$. But, if $b\geq 10, b!\equiv 0 \mbox{ (mod 100)}$. So, we must have $b<10$, giving us the solution $\boxed{(a,b)= (5,5)}$ Noooow, consider WLOG $5<a<b$. Let $b=a+b_0$, where $b_0\in\mathbb{Z^*_+}$ (with a quick check, you can verify that $a=b$ gives us only the solution a=b=5) We know that: $a!(a+1)(a+2)\dots(a+b_0)+a= 5^y\implies a\mid 5^y$. So, $\boxed{\mbox{a is a power of 5}}.$ Call $a= 5^c$, $c\in\mathbb{Z^*_+}$ We have: $b!+5^c= 5^y\implies b!= 5^y-5^c= 5^c(5^{y-c}-1)$ $\implies v_5(b!)=c$, but $b!$ has at least $(c+1)$ factors of 5 (actually much more than this), because he has at least the 5 and $a$(a has c factors 5). $\implies c= v_5(b!)\geq c+1$, contradiction!! Therefore, 3 solutions: $(a,b)= (1,4); (4,1); (5,5)$
16.04.2024 05:09
Clearly $v_5(a!)=v_5(b)$ and $v_5(b!)=v_5(a)$. Since $v_5(a!) \geq v_5(a)$ and $v_5(b!) \geq v_5(b)$, it follows that $v_5(a)=v_5(b)=v_5(a!)=v_5(b!)$. Thus, $v_5((a-1)!)=v_5((b-1)!)=0 \implies a,b \leq 5$. Checking gives $(a,b)=(1,4),(4,1),(5,5)$ as the only solutions.
17.05.2024 22:13
Find all pairs $(a,b)$ of positive integers such that $a!+b$ and $b!+a$ are both powers of $5$. Claim: If $x + y$ is a power of $5$, then $\nu_5(x) = \nu_5(y)$. Proof: Suppose otherwise and WLOG $\nu_5(x) > \nu_5(y)$. Then $\nu_5(x+y) = \nu_5(y)$, so $x + y = 5^{\nu_5(y)} < y$, absurd. $\square$ Hence $\nu_5(a!) = \nu_5(b)$ and $\nu_5(b!) = \nu_5(a)$. Claim: For all $a > 5$, we have $\nu_5(a!) > \nu_5(a)$. Proof: This is equivalent to there being a positive integer multiple of $5$ less than $a$. $\square$ Now for all positive integers $a$, we have $\nu_5(a!) \ge \nu_5(a)$ since $a \mid a!$. Thus, $\nu_5(b) = \nu_5(a!) \ge \nu_5(a)$ and $\nu_5(a) = \nu_5(b!) \ge \nu_5(b)$, meaning $\nu_5(a) = \nu_5(b)$. Then $\nu_5(a!) = \nu_5(b) = \nu_5(a)$ and $\nu_5(b) = \nu_5(a) = \nu_5(b!)$, so $a \le 5$ and $b \le 5$. Thus, $1 < a! + b \le 5! + 5 = 125$, so $a! + b \in \{5, 25, 125\}$. If $a! + b = 5$, then $a = 1, b = 4$, which works, or $a = 2, b = 3$, which doesn't work since $3! + 2$ isn't a power of $5$. If $a! + b = 25$, then $a = 4, b = 1$, which works. If $a! + b = 125$, then $a = b = 5$, which works. Hence the answer is $(a,b) \in \{(1,4), (4,1), (5,5)\}$.
29.05.2024 23:40
We claim the only working ordered pairs are $(a,b)=\boxed{(1,4),(4,1),(5,5)}$. It is easy to see that they work; we now prove they are the only ones. It is not hard to verify that these are the only solutions when $a,b\le 5$, so henceforth, FTSOC, assume $a,b>5$. We must have $a!+b = 5^x$ and $a+b! = 5^y$, for some positive integers $x$ and $y$. Adding these two equations together, we have $a((a-1)!+1) + b((b-1)!+1) = 5^x+5^y$. Note that $v_5(a!), v_5(b!) \ge 1$, and thus $5\mid a$, $5\mid b$. Furthermore, notice that $v_5((a-1)!), v_5((b-1)!) \ge 1$, and hence $5\nmid (a-1)!+1$, $5\nmid (b-1)!+1$. It follows that $v_5(\text{LHS}) = \min\{v_5(a), v_5(b)\}$. We also have $v_5(\text{RHS}) = \min\{x,y\}$. WLOG assume $\min\{v_5(a), v_5(b)\}=v_5(a)$. Now, suppose $\min\{x,y\}=x$. Then, $v_5(a)=x$, and $a\ge 5^x$. But then $a!+b \ge (5^x)!+b > 5^x$, contradiction. Thus, $\min\{x,y\}=y$, and $v_5(a)=y$. Then, $v_5(b)\ge y$, and $b\ge 5^y$. But then $a+b!\ge a+(5^y)! > 5^y$, absurd. Thus, there are no solutions when $a,b>5$, and we are done. $\blacksquare$
28.06.2024 09:49
This was N1 at last year's shortlist.
04.01.2025 04:39
$(1,4), (4,1), (5,5)$ work. Case 1: $a=b$: then $a((a-1)!+1)=5^k$ for some k. clearly a neq 1, so $a$ is a power of 5. $a=5$ works, but if $a$ is 25 or more, $(a-1)!+1)$ isnt a power of 5 since its 1 mod 5. So $(5,5)$ is the only solution here. Case 2: $a>b$. Consider b=1 (edge case since we noticed $(1,4)$ works. Then $a!+1=5^k, a+1=5^j.$ So $a=5^j-1$. If a=4, it works. if a=24 or more, $a! +1 $ is 1 mod 5 again. (same technique as before. we will use it again soon). So $(1,4) (4,1)$ works. Now if $a>b>1$, then $a!+b=5^k, a+b!=5^j$. Then factor out b since $a>b$ to get $b(\frac{a!}{b}+1)=5^k$. So b is a power of 5. Then $a+b!=5^k$ gives $a = 0 \mod 5$. However, then $(\frac{a!}{b}+1)$ would 1 mod 5 (again) ((a would be the next multiple of 5 after b)). So no more solutions.
04.01.2025 06:42
The only pairs are $\boxed{(1, 4), (5, 5)}$ in some permutation. If $a=b$, then we have $a((a-1)!+1)$ to be a power of $5$, or more specifically $(a-1)!+1$ to be a power of $5$. This implies $a-1 < 5$ else it will be $1 \pmod{5}$, and a finite check gives the only solution of $(5, 5)$ as advertised above. Else, WLOG $a>b$. The key idea is that looking at $a!+b$, we can factor out a $b$ from $a!$ and hence $\frac{a!}{b}$ cannot be a multiple of $5$. However, when $a \geq 10$, we can easily see that $v_5(a!)$ is strictly greater than $v_5(b)$ for all $b < a$. This is most easily seen by noticing the gaps between powers of $5$. Therefore, there is a finite check that we need to do with $a \leq 9$, noting again that when $5 \leq a \leq 9$ then $b=5$ to eliminate the factor of $5$. This lands us at the other advertised solution above.
05.01.2025 13:36
Case 1)$a=b\implies x=y$ $a!+a=5^x$ Case 1.1)$a<5$ $a=1\implies 1+1\neq 5^x$ $a=2\implies 2+2\neq 5^x$ $a=3\implies 6+3\neq 5^x$ $a=4\implies 24+4\neq 5^x$ so this case fails Case 1.2)$a\geq 5$ $v_5(a!)\geq v_5(a)$ If $v_5(a!)=v_5(a)\implies a=5\implies a!+a=120+5=125=5^3\implies x=3$ If $v_5(a!)>v_5(a)$ ans also we know that $5|a\implies v_5(a!+a)=min(v_5(a!),v_5(a))=v_5(a)=v_5(5^x)=x\implies a\geq 5^x$ contradiction Case 2) Wlog $a>b>5$ Since $a>b\implies v_5(a!)>v_5(b)\implies v_5(a!+b)=v_5(b)=x\implies b\geq 5^x$ contradiction Case 3)$5>a>b$ By checking we get $4!+1=25=5^2$ $1!+4=5$ so $(a,b)=(4,1)$ if $b>a\implies (a,b)=(1,4)$ I think someone will ask why not $a>5>b$ because if $a>5$ $5|a!\implies 5|b\implies b>5$ since $a\neq b$(case 1) $\boxed{ANSWER:(a,b)=(1,4),(4,1),(5,5)}$
06.01.2025 18:29
W.L.O.G. $a\ge b$. Case 1. If $a=b$. Then we have $a((a-1)!+1)\equiv 0\pmod{5}$. It's easy to check that any $a\le 4$ doesn't works, so we must have $a\ge 5$. For $a=5$, the problem is satisfied. For $a>5$, we have $(a-1)!+1\equiv 1\pmod{5}$. But we have $5^t=a((a-1)!+1)$ for some $t\in\mathbb{N}$, so $(a-1)!+1=1$, a contradiction. So for this case, the only pair that satisfy is $(a,b)=(5,5)$ Case 2. If $a>b$. Let $a=b+k$ for some $k\in\mathbb{N}$. If $a>b\ge 5$, we have $5\mid a,b$. In other side, we have $5^t=b((b+1)(b+2)\dots a+1)$ for some $t\in\mathbb{N}$, so we must have $(b+1)(b+2)\dots a\equiv -1\pmod{5}$.This is a contradiction since we must have $(b+1)(b+2)\dots a\equiv 0\pmod{5}$ (since that $5\mid a$). So we must have $a,b\le 4$, which from that we easily get $(a,b)=(4,1)$. In the end, the only pairs that satisfy the problem are $(a,b)=(5,5),(4,1),(1,4)$. $\blacksquare$