初级数论向玛丽致敬
best simple answer!
If a number is divisible by 3, and you remove any digit and it remains divisible by 3, then the digit that you removed must itself be divisible by 3. If there are no zeros, then the digit must be 3, 6, or 9. And since you can remove *any* digit and the result is still divisible by 3, that means *all* digits must be 3, 6, or 9. And there are 3 * 3 * 3 * 3, or 81, such numbers.
However, the original number isn't guaranteed to be divisible by 3 in the first place. So you also have to include the numbers that aren't divisible by 3 but any 3-digit number made by removing one of its digits is. This occurs when each digit is one greater than a multiple of 3 or when each digit is two greater than a multiple of 3. This means how many four-digit numbers exist such that each digit is a 1, 4, or 7, or each digit is a 2, 5, or 8. The answer for each is 3 * 3 * 3 * 3, or 81.
So the total number of 4-digit numbers that meet the condition is 81 + 81 + 81, or 243.
However, the original number isn't guaranteed to be divisible by 3 in the first place. So you also have to include the numbers that aren't divisible by 3 but any 3-digit number made by removing one of its digits is. This occurs when each digit is one greater than a multiple of 3 or when each digit is two greater than a multiple of 3. This means how many four-digit numbers exist such that each digit is a 1, 4, or 7, or each digit is a 2, 5, or 8. The answer for each is 3 * 3 * 3 * 3, or 81.
So the total number of 4-digit numbers that meet the condition is 81 + 81 + 81, or 243.