(In reply to
Simple analysis (spoiler?) by Steve Herman)
10 for A=1 to 11
20 for B=0 to 11
30 if abs(A-B)>1 then
40 :for C=0 to 11
50 :for D=0 to 11
60 :if abs(C-D)>1 then
70 :for E=0 to 11
80 :N=A*(12^8+1)
90 :N=N+B*(12^7+12)
100 :N=N+C*(12^6+12^2)
110 :N=N+D*(12^5+12^3)
120 :N=N+E*12^4
130 :Tot=Tot+N
140 :next
144 :endif
145 :next
146 :next
150 next B
160 next A
200 print Tot
300 N=Tot
305 S$=" "
310 while N>0
320 D=N @ 12:N=N\12
330 S$=str(D)+S$
340 wend
360 print S$
finds the total in decimal is 371289194344200. Its duodecimal digits are, from left/major to right/units:
3 5 7 8 6 3 11 11 11 4 8 1 10 0
The units digit is zero.
For part 2:
10 for A=1 to 15
20 for B=0 to 15
30 if abs(A-B)>1 then
40 :for C=0 to 15
50 :for D=0 to 15
60 :if abs(C-D)>1 then
70 :for E=0 to 15
80 :N=A*(16^8+1)
90 :N=N+B*(16^7+16)
100 :N=N+C*(16^6+16^2)
110 :N=N+D*(16^5+16^3)
120 :N=N+E*16^4
130 :Tot=Tot+N
140 :next
144 :endif
145 :next
146 :next
150 next B
160 next A
200 print Tot
300 N=Tot
305 S$=" "
310 while N>0
320 D=N @ 16:N=N\16
330 S$=str(D)+S$
340 wend
360 print S$
finds
The total in decimal is 24130586557079520. The hex digits are 5 5 11 10 10 3 15 15 15 4 13 15 14 0. The units digit is zero.
One looks for a reason that both answers for the units digits are zero, that is that the total is divisible by the base. Trying the sum 1+2+3+4+5+6+7+8+9+10+11 = 66 only assures us the first total (base 12) is divisible by 66, but that itself is not divisible by 12.
Steve found the reason.
|
Posted by Charlie
on 2015-01-07 15:12:43 |