|
发表于 22-3-2012 05:31:55|来自:新加坡
|
显示全部楼层
本帖最后由 davidbin 于 22-3-2012 05:48 编辑
Misunderstood the question, correction is below
Total 5 digits number from 10000~99999: 99999-10000+1 = 90000,
90000/3 = 30000
So in total there are 30000 number multiples of 3 among 5 digits number
Without single digit of 3 could be
1a1a2a3a4
2a1a2a3a4
4a1a2a3a4
5a1a2a3a4
.....
9a1a2a3a4
a1,a2,a3,a4 belong (0,1,2,4,5,6,7,8,9)
0,1,2,4,5,6,7,8,9 mod 3 , the result can be grouped into 3
R0(0,6,9), R1(1,4,7), R2(2,5,8),each group has 3 numbers
1a1a2a3a4 total possiblity is 9X9X9X3= 2187
get a1,a2,a3 from (0,1,2,4,5,6,7,8,9), 9 choices for each number. For every 1, a1,a2,a3 combination, you always have 3 choices for a4 to ensure the number 1a1a2a3a4 can be devided by 3
(1,2,4~9)a1a2a3a4 total possibility = 8x2187=17496
Result = 30000- 17496 = 12504
Below formula valid for 3 & 9
(90000- 8x9x9x9x9)/X x=3 or 9
|
|