jga000 发表于 2017-6-21 11:06 
A computer is programmed to print the multiples of 8 in increasing order starting with 8. As it pr ...
我也不知道6年纪的怎么快速解这个。
但是答案应该是2734, 最后一个被8整除的数是21872。我是用计算机算出来的。
select *
from (
select id, eight_multiple, sum(num_two) over (order by id rows unbounded preceding) num_two_total
from (
select rownum id, 8*rownum eight_multiple, nvl(length(trim(translate(to_char(8*rownum),'0123456789',' 2 '))),0) num_two
from all_objects
where rownum<10000
)
)
where num_two_total=2017
另外0-999里面被8整除的数里面,一共有55个2,不是53.
EIGHT_MULTIPLE,RUNNING_TOTAL_2S
8,0
16,0
24,1
32,2
40,2
48,2
56,2
64,2
72,3
80,3
88,3
96,3
104,3
112,4
120,5
128,6
136,6
144,6
152,7
160,7
168,7
176,7
184,7
192,8
200,9
208,10
216,11
224,13
232,16
240,17
248,18
256,19
264,20
272,23
280,24
288,25
296,26
304,26
312,27
320,28
328,29
336,29
344,29
352,30
360,30
368,30
376,30
384,30
392,31
400,31
408,31
416,31
424,32
432,33
440,33
448,33
456,33
464,33
472,34
480,34
488,34
496,34
504,34
512,35
520,36
528,37
536,37
544,37
552,38
560,38
568,38
576,38
584,38
592,39
600,39
608,39
616,39
624,40
632,41
640,41
648,41
656,41
664,41
672,42
680,42
688,42
696,42
704,42
712,43
720,44
728,45
736,45
744,45
752,46
760,46
768,46
776,46
784,46
792,47
800,47
808,47
816,47
824,48
832,49
840,49
848,49
856,49
864,49
872,50
880,50
888,50
896,50
904,50
912,51
920,52
928,53
936,53
944,53
952,54
960,54
968,54
976,54
984,54
992,55
|