devarshi-dt-logo

Question:

The number of 5-digit numbers which are divisible by 4, with digits from the set {1, 2, 3, 4, 5} and the repetition of digits is allowed, is ________?

Solution:

A number is divisible by 4 if the last two digits of that number are divisible by 4.
The 2-digit numbers which are divisible by 4 from the given set {1, 2, 3, 4, 5} are 12, 24, 32, 44, and 52.
So, if a number ends with 12, 24, 32, 44, or 52, then it is divisible by 4.
The first 3 digits can be arranged in 5³ ways.
So, the total number of 5-digit numbers which are divisible by 4 with repetition allowed is 5³ × 5 = 125 × 5 = 625.