The question is, given N of four digts and M which is based on any three digits of N (but in the same order as those of N) and the difference between N and M is 2021, what is the original number N?
The way I have worked this out is to take all four digits of 2021 and add all four (2+0+2+1) =5 to give me the last digit of N so N = ???5. Then I take the first three digits of 2021 and add them (2+0+2) = 4 to give me the third digit of N so N = ??45. Next I take the first two digits of 2021 and add then (2+0) = 2 to give me the second digits of N so N = ?245 and finally I take the first digit of 2021 and 'add' it (2) = 2 and use that as the first digit of N so N = 2245. If I then 'lose' the last digit of N (e.g. the '5) I have M of 224.
This works because 2245 - 224 = 2021
But why? Is there a general solution for this? What am I missing?