Maths Olympiad Prep

Library / /216 of 220

Number theory Difficulty 7.8 National Olympiad, round 2 Prove it Ukraine

a) For which positive integer ll there exists a pair of positive integers (m,n)(m, n), which consist of no more than ll digits, have different last digits and which satisfy the condition: the last ll digits of m2m^2 form the number nn, and analogously, the last ll digits of n2n^2 form number mm (discarding any zeros that the last ll digits may begin with).

b) For which positive integer ll there exists a pair of positive integers (m,n)(m, n), which consist of no more than ll digits, have different last digits and which satisfy the condition: the last ll digits of m3m^3 form the number nn, and analogously, the last ll digits of n3n^3 form number mm (discarding any zeros that the last ll digits may begin with).

Solutions — 2

Solution 1

a) Consider the last digits of numbers satisfying the conditions of the problem. We follow the last digit of their squares, so we put the matching the last digit to each square:

121,224,329,426,525,626,729,824,9211^2 \rightarrow 1, 2^2 \rightarrow 4, 3^2 \rightarrow 9, 4^2 \rightarrow 6, 5^2 \rightarrow 5, 6^2 \rightarrow 6, 7^2 \rightarrow 9, 8^2 \rightarrow 4, 9^2 \rightarrow 1

b) Analogously to a), we find those single-digit numbers that satisfy the conditions and write down the last digit for each third power:

131,238,337,434,535,636,733,832,9391^3 \rightarrow 1, 2^3 \rightarrow 8, 3^3 \rightarrow 7, 4^3 \rightarrow 4, 5^3 \rightarrow 5, 6^3 \rightarrow 6, 7^3 \rightarrow 3, 8^3 \rightarrow 2, 9^3 \rightarrow 9

- pairs (3;7)(3; 7) and (2;8)(2; 8) satisfy the conditions.

For example, we already found a pair of ll-digit numbers (m,n)(m, n), satisfying the condition: mm's last digit is 22 its third power ends with nn, and analogously, number nn's last digit is 88 and its third power ends with mm. Let us try to find l+1l+1-st digits of these numbers. In all equalities, all digits to the left of l+1l+1-st one are discarded. We denote the unknown numbers by xm\overline{xm} and yn\overline{yn}.

Then let m3=10A+nm^3 = 10' A + n, n3=10B+mn^3 = 10' B + m, which yields:

xm3=(10x+m)3310xm2+m3=310x4+10A+n10(2x+A)+n=yn=10y+n,yn3=(10y+n)3310yn2+n3=310y4+10B+m10(2y+B)+m=xm=10x+m. \begin{align*} \overline{xm}^3 &= (10' x + m)^3 \rightarrow 3 \cdot 10' x \cdot m^2 + m^3 = 3 \cdot 10' x \cdot 4 + 10' A + n \rightarrow \\ &\rightarrow 10' (2x + A) + n = \overline{yn} = 10' y + n, \\ \overline{yn}^3 &= (10' y + n)^3 \rightarrow 3 \cdot 10' y \cdot n^2 + n^3 = 3 \cdot 10' y \cdot 4 + 10' B + m \rightarrow \\ &\rightarrow 10' (2y + B) + m = \overline{xm} = 10' x + m. \end{align*}

After simplifications and reductions, get the system:

{2x+A=y,2y+B=x. \begin{cases} 2x + A = y, \\ 2y + B = x. \end{cases}

From which, x=2y+B=2(2x+A)+B=4x+(2A+B)x = 2y + B = 2(2x + A) + B = 4x + (2A + B), hence, {3x=(2A+B),3y=(2B+A).\begin{cases} 3x = -(2A + B), \\ 3y = -(2B + A). \end{cases}

Since for arbitrary A,BA, B there exist corresponding digits x,yx, y (recall that the equality only applies to the last digits here), and 3x3x and 3y3y take all possible values.

Thus, corresponding pairs of numbers exist for any value of ll.

Let us show by examples: the transition from a single-digit number to a two-digit number:

m1=2,m13=8100+8A=0,n1=8,n13=512101+2B=1.3x(2A+B)=19x=3,3x(2B+A)=28y=6. \begin{align*} m_1 = 2, m_1^3 = 8 &\rightarrow 10 \cdot 0 + 8 \Rightarrow A = 0, n_1 = 8, n_1^3 = 512 \rightarrow 10 \cdot 1 + 2 \Rightarrow B = 1. \\ 3x \rightarrow -(2A+B) = -1 &\rightarrow 9 \Rightarrow x = 3, 3x \rightarrow -(2B+A) = -2 \rightarrow 8 \Rightarrow y = 6. \end{align*}

We obtain the numbers:

m2=xm1=32,m23=323=32768,n2=yn1=68,n23=683=314432, m_2 = \overline{xm_1} = 32, m_2^3 = 32^3 = 32768, n_2 = \overline{yn_1} = 68, n_2^3 = 68^3 = 314432,

which satisfy the statement.

The transition from a two-digit number to a three-digit number:

m2=32,m23=327681007+68A=7.n2=68,n23=3144321004+32B=4. \begin{align*} m_2 = 32, m_2^3 = 32768 &\rightarrow 100 \cdot 7 + 68 \Rightarrow A = 7. n_2 = 68, n_2^3 = 314432 \rightarrow 100 \cdot 4 + 32 \\ &\Rightarrow B = 4. \end{align*}

m3=xm2=432,m33=4323=80621568,n3=yn2=568,n33=5683=183250432, m_3 = \overline{xm_2} = 432, m_3^3 = 432^3 = 80621568, n_3 = \overline{yn_2} = 568, n_3^3 = 568^3 = 183250432,

which, too, satisfy the statement.

Solution 2

b) Let us prove that such pair exists for every value of ll. We show that there is such positive integer xx that 2lx212^l \mid x^2 - 1 and 5lx2+15^l \mid x^2 + 1.

For the first divisibility, we set x1(mod2l)x \equiv 1 \pmod{2^l}. Using Method of Mathematical Induction (MMI) for ll, we show that for any ll there exists xx such that 5lx2+15^l \mid x^2 + 1. If l=1l = 1, then we set x=2x = 2.

Suppose for some ll, the statement holds. Consider l+1l+1: if xx works for ll, i.e. x2+1=t5lx^2+1=t \cdot 5^l, then we set x1=x+k5lx_1 = x+k \cdot 5^l; so

x12+1=x2+k252l+2xk5l+1=t5l+k252l+2xk5l=5l(t+k25l+2xk). x_1^2 + 1 = x^2 + k^2 \cdot 5^{2l} + 2xk \cdot 5^l + 1 = t \cdot 5^l + k^2 \cdot 5^{2l} + 2xk \cdot 5^l = 5^l(t + k^2 \cdot 5^l + 2xk).

Obviously, there exists such kk that the expression in parentheses is divisible by 55, we choose such x1x_1 for this kk, and the statement is proved.

Then, by the Chinese remainder theorem, we select xx which satisfies both conditions. Then, we show that the last ll digits of the pair xx and x3x^3 satisfy the statement. Firstly, by the construction, both numbers have no more than ll digits. Secondly, they have different last digits: otherwise, x3xx^3 - x would be divisible by 55, but x3x=x(x21)2x(mod5)x^3 - x = x(x^2 - 1) \equiv -2x \pmod 5 hence, xx must have been divisible by 55, which, obviously, is impossible if x2+1=t5lx^2 + 1 = t \cdot 5^l.

It is left to show that xx30(mod10l)x - x^3 \equiv 0 \pmod{10^l}, which is obvious by construction, and also

(x3)3x=x9x=x(x4+1)(x2+1)(x21)0(mod10l), (x^3)^3 - x = x^9 - x = x(x^4 + 1)(x^2 + 1)(x^2 - 1) \equiv 0 \pmod{10^l},

which is obvious, as well.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.