Write a nonnegative integer N as ten a plus b, where b is its final decimal digit and a is the remaining prefix. Prove that N is divisible by seven exactly when a minus two b is divisible by seven. This original number-theory exercise explains why a short mental test works. It does not treat a collection of successful examples as proof or assume that the transformed number must remain positive.
Need help choosing a next step? Scan the contact QR code below or contact Hanlin on WeChat. Send UKMT-S5-1126 and tell us your school year and question.
Express the transformation algebraically
Ten times the quantity (a minus two b) is ten a minus twenty b. Since N equals ten a plus b, the difference between N and that transformed multiple is twenty-one b, which is always divisible by seven. Therefore N and ten times a minus two b have the same remainder modulo seven.
Prove the forward implication carefully
If N is divisible by seven, then ten times a minus two b is also divisible by seven. Because ten and seven have no common factor, divisibility of that product by seven implies divisibility of a minus two b. The coprime step is needed; a factor cannot always be cancelled from a divisibility statement.
Prove the converse as well
If a minus two b is divisible by seven, its product with ten is divisible by seven. Adding twenty-one b gives N, which is therefore divisible by seven. Together the two directions establish equivalence, so repeated application neither loses a divisible input nor accidentally converts a nondivisible input into a divisible one.
Check an accepted and a rejected example
For two hundred three, the prefix is twenty and the final digit three, giving twenty minus six, or fourteen. Since fourteen is divisible by seven, so is two hundred three; indeed it equals seven times twenty-nine. For two hundred twenty-one, the transformation gives twenty-two minus two, or twenty, which is not divisible by seven.
Handle zero and negative results honestly
For fourteen, the transformation is one minus eight, or negative seven. Negative seven is divisible by seven, so the test still works. A zero result also counts as divisible. Replacing a negative result by its absolute value preserves this particular divisibility question, but discarding it as an invalid output would break a valid test.
Do not confuse this rule with the digit-sum test
Adding decimal digits directly is suited to different modulus relationships, such as nine, and is not the derivation used here. A useful shortcut retains its base-ten representation and coprimality argument. Official UKMT resources are linked separately. This original proof practice is not a reproduced contest task; the purpose is to turn a memorised algorithm into a reversible mathematical statement with checked boundary cases.
Continue reading: UKMT Number Practice: Find a Missing Digit with Divisibility by Nine.
Contact Hanlin
Planning a first attempt or reviewing a topic you find difficult? Scan the QR code and send UKMT-S5-1126. Include your school year, country or competition region, experience and the question you want to discuss.

On your phone, use the button or save the QR image and scan it within WeChat.
Official information and further reading: Source 1
