The possible combinations of nonzero digits in such an 8-digit number are as follows:
We take each case in turn.
(i) The only possible 8-digit number is 40000000.
(ii) The leading digit must be 1 or 3, and the other digit can be placed in any of the other 7 places. Thus there are 7 + 7 = 14 such 8-digit numbers.
(iii) One 2 is the leading digit and the other 2 can be placed in any of the other 7 places, so number of such 8-digit numbers is 7.
(iv) If the leading digit is 2, the two 1’s can be placed in the other places in 7C2 = 21 ways. If the leading digit is 1, the other two digits can be placed in the other places in 7P2 = 42 ways. ∴ Number of such 8-digit numbers = 21 + 42 = 63.
(v) One of the 1’s is the leading digit and the other 3 can be placed in the other places in 7C3 = 35 ways.
Hence the total number of such 8-digit numbers is 1 + 14 + 7 + 63 + 35 = 120.