Official solution
Since the five-digit number must be greater than 40000, the only options for the first digit are 5, 7, or 9. That leaves 3 remaining choices for the first digit.
Since the number has to be divisible by 5, the last digit must be 0 or 5. If the first digit is 5, the last digit can only be 0, since digits cannot be repeated. If the first digit is 7 or 9, the last digit can be 0 or 5, so there are 2 choices.
Five possible configurations for the first and last digits :
- 5xxx0
- 7xxx0
- 7xxx5
- 9xxx0
- 9xxx5
For each of these configurations, there are three places in the middle that can be filled with the remaining 4 unused digits.
Since repetition isn't allowed, there are 4 options for the second digit, 3 for the third, and 2 for the fourth, which can be represented as 4P3, or permutations of 4 items taken 3 at a time. This is equal to 4 \[ \times \] 3 \[ \times \] 2 = 24.
So, for each of the 5 configurations, there are 24 ways to arrange the middle three digits. Therefore, the total number of five-digit numbers that meet the criteria is 5 \[ \times \] 24 = 120.