A base ten number formed by writing the digit seven precisely 2011 times is denoted by N. That is:
N = 77……77 (2011 times).
Let us denote x = [N/9], y = [x/9] and, z = [y/9]
Determine the
digital root of z.
Note: [P] denotes the greatest integer ≤ P
**** For an extra challenge, solve this puzzle without using a computer program.
The digital root of z is 6.
Lines 60 through 290 of the below program are not really needed for this solution, but were added to display the digital roots also for N, x and y, which are 1, 4 and 7 respectively.
list
20 for I=1 to 2011:N=N*10+7:next
30 X=N\9
40 Y=X\9
50 Z=Y\9
60 Dr=0:Num=N
70 while Num>0
80 Dr=(Dr+Num @ 10) @ 9:Num=Num\10
90 wend:print Dr
160 Dr=0:Num=X
170 while Num>0
180 Dr=(Dr+Num @ 10) @ 9:Num=Num\10
190 wend:print Dr
260 Dr=0:Num=Y
270 while Num>0
280 Dr=(Dr+Num @ 10) @ 9:Num=Num\10
290 wend:print Dr
360 Dr=0:Num=Z
370 while Num>0
380 Dr=(Dr+Num @ 10) @ 9:Num=Num\10
390 wend:print Dr
OK
run
1
4
7
6
OK
|
Posted by Charlie
on 2011-09-13 13:41:33 |