The puzzle is based on 2 provable facts:
1. An integer is divisible by 9 IFF the sum of its digits is divisible by 9.
2. If you take any 2 permutations of the same set of digits, and
subtract one from the other, the result is always divisible by 9.
Given these facts, the puzzle operation is simple. After subtraction you
have a number divisible by 9.
You tell me all the digits except 1. I add them up in modulo 9, giving X, where X is a digit 0..9.
The missing digit D is given by 9 - X. If I get X = 3, the missing digit must be a 6.
You are asked not to omit a zero, because I can't tell then whether you omitted a 0 or a 9.
Proofs:
1. Divisibility by 9
Any integer M is a sum of terms a(n) * 10^n, n = 0, 1, 2 ....
where each a(n) is a digit 0..9
So we write
M = Sum[ a(n) * 10^n ] (for each n = 0, 1 , 2, etc)
So, M mod 9 = Sum[ (a(n) * 10^n) mod 9 ]
But 10^n mod 9 = 1 for any n, so
M mod 9 = Sum[ a(n) mod 9 ]
= Sum[ a(n) ] mod 9
QED
2. Subtraction of any 2 permutations of an integer is divisible by 9
Given M as defined above, if M2 is a permutation of M, then
M2 = Sum[ a(n) * 10^m(n) ] (for each n = 0, 1 , 2, etc)
Notice I've just changed the power of 10, each m(n) is also 0, 1, 2 etc
but in some other order.
Example: 4321 = 1 + 2x10 + 3x100 + 4x1000
2134 1x100 + 2x1000 + 3x10 + 4
Subtraction gives
(M - M2) mod 9 = Sum[ a(n) * (10^n - 10^m(n)) ] mod 9
But we know ANY power of 10 = 1 mod 9, so
= Sum[ a(n) * (1 - 1) ] mod 9
= 0 mod 9
QED