fairly easy. if you pick a 3 numbered number, after subtracting, the digits of the answer will always add up to 9, if you pick a 4 digit number, after subtracting the digits will always equal 18.
when leaving one number out, it's just a case of subtracting the total of the digits you decide to enter, from 9 (3 digit original number) or 18 (if your original number had 4 digits)....
very cool trick tho