Olympiad Maths Prep

Track / Stage 7 / 37 of 300 #1437 of 2000

Problem 1437

National olympiad second round; IMO P1/P4
Number theory Difficulty 7.0 Prove it

A 6n6n-digit number is divisible by 77. Prove that if its last digit is moved to the beginning of the number then the new number is also divisible by 77.

This one wants a proof. Work it on paper, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solution

1. Let M M be a 6n 6n -digit number that is divisible by 7 7 . We can express M M in the form:
M=10x+y M = 10x + y
where x x is an integer such that 106n1x<106n 10^{6n-1} \leq x < 10^{6n} and y y is the last digit of M M with 0y<10 0 \leq y < 10 .

2. When the last digit y y of M M is moved to the beginning, the new number N N can be written as:
N=y106n1+x N = y \cdot 10^{6n-1} + x

3. Since M M is divisible by 7 7 , we have:
7M    7(10x+y) 7 \mid M \implies 7 \mid (10x + y)

4. By Fermat's Little Theorem, we know that:
1061(mod7) 10^6 \equiv 1 \pmod{7}
This implies:
106n1(mod7) 10^{6n} \equiv 1 \pmod{7}

5. Using the above result, we can rewrite N N modulo 7 7 :
N=y106n1+x N = y \cdot 10^{6n-1} + x

6. Since 106n1(mod7) 10^{6n} \equiv 1 \pmod{7} , we have:
106n1101(mod7) 10^{6n-1} \equiv 10^{-1} \pmod{7}
To find 101(mod7) 10^{-1} \pmod{7} , we need the multiplicative inverse of 10 10 modulo 7 7 . Since 103(mod7) 10 \equiv 3 \pmod{7} , we need the inverse of 3 3 modulo 7 7 . The inverse of 3 3 modulo 7 7 is 5 5 because:
35151(mod7) 3 \cdot 5 \equiv 15 \equiv 1 \pmod{7}
Therefore:
106n15(mod7) 10^{6n-1} \equiv 5 \pmod{7}

7. Substituting this back into the expression for N N :
Ny5+x(mod7) N \equiv y \cdot 5 + x \pmod{7}

8. Since 7(10x+y) 7 \mid (10x + y) , we have:
10x+y0(mod7) 10x + y \equiv 0 \pmod{7}
This implies:
10xy(mod7) 10x \equiv -y \pmod{7}
Using 103(mod7) 10 \equiv 3 \pmod{7} , we get:
3xy(mod7) 3x \equiv -y \pmod{7}
Multiplying both sides by 5 5 (the inverse of 3 3 modulo 7 7 ):
x5y(mod7) x \equiv -5y \pmod{7}

9. Substituting x5y(mod7) x \equiv -5y \pmod{7} into the expression for N N :
Ny5+(5y)5y5y0(mod7) N \equiv y \cdot 5 + (-5y) \equiv 5y - 5y \equiv 0 \pmod{7}

10. Therefore, N N is divisible by 7 7 :
7N 7 \mid N

\blacksquare

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.