Consider the smallest five digit number _6789. Guess the digit that can fit in the blank space, if the number is divisible by 9 in one case and 3 in the other case.
Let's assume the digit in black space be d.
For divisibility by 9:
Sum of all the digit must be divisible by 9.
⇒d+6+7+8+9=d+30
The smallest digit d that can fit is 6 as
⇒6+30=36
which is divisible by 9.
∴d=6
For divisibility by 3:
Sum of all the digit must be divisible by 3.
⇒d+6+7+8+9=d+30
Let the smallest digit d=0.
→0+30=30,
which is divisible by 3.
The number becomes 06789, which is a four-digit number.
∴d should be greater than 0.
For d=3,
Sum of all the digits = 3+6+7+8+9=33, which is divisible by 3.
∴d=3
Hence, the digits are 6 and 3, respectively.