Let $ m$ and $ n$ be positive integers such that $ 1 \le m < n$. In their decimal representations, the last three digits of $ 1978^m$ are equal, respectively, to the last three digits of $ 1978^n$. Find $ m$ and $ n$ such that $ m + n$ has its least value.
Problem
Source: IMO LongList, Cuba 3, IMO 1978, Day 1, Problem 1
Tags: modular arithmetic, number theory, Digits, decimal representation, IMO, IMO 1978
20.12.2005 19:13
$1978^m \equiv 1978^n$ $\mod 1000$ $1978^m \equiv 1978^{4k + m}$ where $k = 1, 2...$ $1978^m(1978^{4k} - 1) \equiv 0$ $5$'s comes from second factor and $2$'s from the first one. Hence $m = 3$ $1978^{4k} \equiv 1$ $\mod 125$ $22^{4k} \equiv 1$ $\Longrightarrow$ $6^k \equiv 1$ $6^{\phi (125)} \equiv 1$ $\mod 125$ $6^{100} \equiv 1$ $6^{100} \equiv 6^{25h} \equiv 1$ $\mod 125$ where $h = 1, 2...$ So $n = 4k + m = 103$ and $(3, 103)$ is the solution.
24.12.2013 15:52
orl wrote: Let $ m$ and $ n$ be positive integers such that $ 1 \le m < n$. In their decimal representations, the last three digits of $ 1978^m$ are equal, respectively, so the last three digits of $ 1978^n$. Find $ m$ and $ n$ such that $ m + n$ has its least value. We have $1978^m\equiv 1978^n\pmod {1000}$, or $978^m-978^n=1000k$ for some positive integer $k$ (if it is not positive just do $978^n-978^m=-1000k$). Hence $978^n\mid 1000k$. So dividing through by $978^n$ we get $978^{m-n}-1=\frac{1000k}{978^n}$. Observe that $2\nmid LHS$, so $2\nmid RHS$. So since $2|| 978^n$, clearly the minimum possible value of $n$ is $3$ (and then $489^n\mid k$). We will show later that if $n$ is minimal then $m$ is minimal. We have $978^{m-3}-1\equiv 0\pmod {125}\Leftrightarrow 103^{m-3}\equiv 1\pmod {125}$. Hence, $m-3\mid \varphi(125)\Rightarrow m-3\mid 100$. Checking by hand we find that only $m-3=100$ works (this also shows that minimality of $m$ depends on $n$, as claimed above). So $m=103$. Consequently, $m+n=106$ with $\boxed{(m,n)=(103,3)}$.
05.12.2021 11:44
I want to add another solution for the 2nd part of the problem: to find a = n - 3, so that 1978^k is equivalent 1 (mod 125) without an "advanced" Theorem. Step 1: modulo 5 1978 is equivalent 3 (mod 5), so 1978^4 is equivalent 3^4 (mod 5). 3^4 = 81 is equivalent 1 (mod 5). -->a must be a multiply of 4 Step 2: modulo 25 1978^4 is equivalent 3^4 (mod 25). 3^4 = 81 is equivalent 6 (mod 25). 1978^4b is equivalent 6^b (mod 25). Because 6=5+1, it's easy to show that (5+1)^5 is equivalent 1 (mod 25) -->b must be a multiply of 5 --> a is a multiply of 20 Final step: modulo 125 1978 is equivalent -22 (mod 125). 1978^20 is equivalent (-22)^20 equivalent 484^10 equivalent (-16)^10 equivalent 256^5 equivalent 6^5 (mod 125). Because 6=5+1, it's easy to show that (5+1)^5 is equivalent 5^2 + 1 (mod 125). So 1978^20c is equivalent (5^2 + 1)^c (mod 125). It's also easy to show that (5^2 + 1)^5 is equivalent 1 (mod 125) --> k = 20*5 = 100 P.S: I tried to post the full version with Latex, but new users can't post image. So I replace some calculations with "it's easy to show"