1. Let M be a 6n-digit number that is divisible by 7. We can express M in the form:
M=10x+y
where x is an integer such that 106n−1≤x<106n and y is the last digit of M with 0≤y<10.
2. When the last digit y of M is moved to the beginning, the new number N can be written as:
N=y⋅106n−1+x
3. Since M is divisible by 7, we have:
7∣M⟹7∣(10x+y)
4. By Fermat's Little Theorem, we know that:
106≡1(mod7)
This implies:
106n≡1(mod7)
5. Using the above result, we can rewrite N modulo 7:
N=y⋅106n−1+x
6. Since 106n≡1(mod7), we have:
106n−1≡10−1(mod7)
To find 10−1(mod7), we need the multiplicative inverse of 10 modulo 7. Since 10≡3(mod7), we need the inverse of 3 modulo 7. The inverse of 3 modulo 7 is 5 because:
3⋅5≡15≡1(mod7)
Therefore:
106n−1≡5(mod7)
7. Substituting this back into the expression for N:
N≡y⋅5+x(mod7)
8. Since 7∣(10x+y), we have:
10x+y≡0(mod7)
This implies:
10x≡−y(mod7)
Using 10≡3(mod7), we get:
3x≡−y(mod7)
Multiplying both sides by 5 (the inverse of 3 modulo 7):
x≡−5y(mod7)
9. Substituting x≡−5y(mod7) into the expression for N:
N≡y⋅5+(−5y)≡5y−5y≡0(mod7)
10. Therefore, N is divisible by 7:
7∣N
■