
David W. answered 05/18/16
Tutor
4.7
(90)
Experienced Prof
"Four digit numbers" does not allow leading zeros, so consider 1000 - 9999.
If repetition is allowed, then every number ending with either 0 or 5 is divisible by five. There are 9000 values and 2 out of 10 (or 1 out of 5) of them are divisible by 5, so 9000/5 = 1800 are divisible by 5 -- if repetition is allowed.
However, if repetition of digits is not allowed, we have:
4th digit must be either 0 or 5 -- 2 choices
1st digit may be (1,2,3,4,5,6,7,8,9) -- 9 choices
2nd digit may be (0,1,2,3,4,5,6,7,8,9) -- 10 choices, but not same as 1st digit or 4th digit
3rd digit may be (0,1,2,3,4,5,6,7,8,9) -- 10 choices, but not same as 1st or 2nd digit or 4th digit
So, since the 1st digit cannot be 0 but can be 5, there are:
If the last digit is 0:
9 * 8 * 7 * 1 = 504 if the 4th digit is 0, the 1st digit can be (1,2,3,4,5,6,7,8,9), the 2nd digit can be (1,2,3,4,5,6,7,8,9 but not same as 1st digit) and the 3rd digit can be (1,2,3,4,5,6,7,8,9 but not same as 1st digit or 2nd digit).
If the last digit is 0:
8 * 8 * 7 * 1 = 448 if the 4th digit is 5, the 1st digit can be (1,2,3,4,6,7,8,9), the 2nd digit can be (1,2,3,4,6,7,8,9 but not same as 1st digit) and the 3rd digit can be (1,2,3,4,6,7,8,9 but not same as 1st digit or 2nd digit).
That gives a total of 504+448 = 952 numbers that are divisible by 5 with no repeating digits.
Rajeev S.
In the eqn =448, the first digit would belong to {1,2,3,...,9} - {5}, so now a number from this set and '5' would be taken away. for the second digit, the other 8 numbers would be left, and 7 for the 3rd digit
Report
12/23/20

David W.
count = 0 FOR a = 1 TO 9 FOR b = 0 to 9 IF (a<>b) THEN FOR c = 0 TO 9 IF ( (a<>b) AND (a<>c) AND (b<>c) ) THEN FOR d = 0 TO 5 BY 5 IF ( (d<>a) AND (d<>b) AND (d<>c) ) THEN count = count + 1 ENDIF ENDFOR ENDIF ENDFOR ENDIF ENDFOR ENDFOR OUTPUT x&" done." END 952 done."
Report
12/23/20
Elyse R.
Good Day, sir, I think in the 2nd digit of the equation that equates to 448, we can use 0 already. That's why there are still 8 chances, and 7 chances on the 3rd digit. Is it correct?10/09/20