The goal is to find the smallest number (let's call it M) such that:
- If M obeys property X, then the digit X is part of the number.
- If M does not obey property X, then the digit X is NOT part of the number.
For example, if 2457 were a magic number, it would obey properties 2, 4, 5, 7 and not 0, 1, 3, 6, 8, 9. However we find that not to be the case, so it is not the number we are looking for.