A hundred digit number is formed by writing the first few natural numbers in front of each other as follows:
12345678910111213141516171819…………………
Find the remainders when this number is divided by each of the numbers from 1 to 20.
1 0
2 1
3 2
4 1
5 0
6 5
7 6
8 1
9 5
10 5
11 1
12 5
13 1
14 13
15 5
16 9
17 3
18 5
19 4
20 5
from the UBASIC program
5 S$=""
10 for I=1 to 55
20 S$=S$+cutspc(str(I))
30 next
40 S$=left(S$,100)
50 S=val(S$)
60 for I=1 to 20
70 print I;S@I
80 next
|
Posted by Charlie
on 2006-03-20 11:33:14 |