Is N exactly divisible by 7?
Let N = 10n + a where n and a are integers and a is in the units position.
Construct M = n - 2a (i.e. twice the units value subtracted from what's left, where what's left is considered to be a number in its own right).
If M is exactly divisible by 7 then we can write n - 2a = 7m where m is an integer.
So n = 7m + 2a
In that case N = 10(7m + 2a) + a or N = 70m + 21a
So N/7 = 10m + 3a and since m and a are integers the resulting value of N/7 is an integer. i.e. N is exactly divisible by 7 with no remainder.
.