Complements of 10 and 100
Subtract any number from 100, 1000 or 10000 in a single left-to-right pass, without borrowing once.
Subtract from a round power of ten without borrowing once.
The trick
Take every digit from 9, and the last one from 10. Left to right, writing the answer as you go.
Pad a short number with leading zeros first, or the digits sit against the wrong places.
The answer can come out with a leading zero of its own, which you drop: 100 − 97 gives 9−9 then 10−7, so 03, so 3.
Why it works
1000 is 999 + 1. Subtract from 999 instead, and no borrow is possible: every digit of a three-digit number is at most 9, so every column subtracts cleanly. Then give the 1 back.
Digit by digit, 999 − n is nothing but 9 minus each digit — that is “all from 9”. The 1 you owe lands in the units, turning that last 9 − d into 10 − d — that is “the last from 10”. The rule is not two rules; it is one subtraction and a returned 1.
Which also says exactly when it fails. Adding 1 to the units only stays a single-digit change while that unit is below 9, and 9 − d is 9 only when d is 0. So a number ending in 0 breaks the digitwise version: 999 − 470 is 529, and the returned 1 makes 530 — not the “5, 2, 10” the rule appears to promise. Strip the trailing zeros, complement what is left, and put them back.
It goes further
Round numbers that are not powers of ten work too. Complement the last two digits against 100, and drop the leading digit by one more than you take away — that one is the hundred you spent doing the complement.
It is also the sum you already do at a till, where the power of ten is the note you handed over. Change from a ten-pound note for £3.68 is 1000 − 368 pence.
The phrasing “all from nine and the last from ten” is the first sutra of Bharati Krishna Tirtha’s Vedic Mathematics, a twentieth-century compilation first published in 1965.