Each of A and B is a (base 15) positive integer , with A containing precisely 201 digits and, B containing precisely 202 digits, where:
A = 77…..779 (the digit 7 is repeated precisely 200 times followed by 9), and:
B= 77…..779 (the digit 7 is repeated precisely 201 times followed by 9)
Determine the distinct digits in the base 15 representation of A2. What are the distinct digits in the base 15 representation of B2?
*** For an extra challenge, solve this puzzle without the help of a computer program.
10 Repu=(15^200-1)//14
20 A=7*Repu+2
30 Repu=(15^201-1)//14
40 B=7*Repu+2
50 Asq=A*A:Bsq=B*B
60 while Asq>0
65 if Asq @ 15=12 then A12=Act+1
70 print Asq @ 15;:Asq=Asq\15:Act=Act+1
80 wend
90 print:print
160 while Bsq>0
165 if Bsq @ 15=5 then B5=Bct+1
170 print Bsq @ 15;:Bsq=Bsq\15:Bct=Bct+1
180 wend
190 print:print
200 print Act,Bct
210 print A12,B5
produces this output:
6 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 1
1 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 5 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 1
1 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3
6 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 1
1 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 12 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 1
1 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11
3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3 1
1 3 11 3 11 3 11 3 11 3 11 3 11 3 11 3
402 404
202 203
The first portion consists of the digits of A^2 in reverse order and then the digits of B^2, also in reverse order. The occurrences of 11 and 12 are decimal notations for what conventionally are written B and C, considered as digits in a higher-than-ten base system.
The penultimate line shows the lengths of A^2 and B^2 as 402 and 404 base-15 digits respectively. The last line was the result of code entered after seeing the first portion of the printout: the location of the unusual digit in the middle of the number.
A^2 starts with 100 occurrences of the pair 3B, then a 5, then 100 more occurrences of 3B and finally a 6.
The first 201 digits of B^2 are alternating 3 and B (that is, 3 and 11), therefore beginning and ending with 3. The next digit is a C (i.e., 12) and the next 201 digits are alternating B and 3 (11 and 3), with the B at the beginning and end this time. The final digit is a 6.
So the distinct digits of A^2 are 3, B, 5 and 6; the distinct digits of B^2 are 3, B, C and 6.
|
Posted by Charlie
on 2010-12-15 19:07:19 |