Each of A and B is a tridecimal (base 13) positive integer, where A is formed by writing the digit 4 precisely 666 times and, B is formed by writing the digit 6 precisely 666 times.
Determine the distinct digits that appear in the tridecimal representation of the product A*B.
Note: For an extra challenge, solve this problem using only pencil and paper.
An n-digit base 13 repunit (number whose digits are all 1) has a value of (13^n-1)/12. Then the base 13 number of 666 4s is 4*(13^666-1)/12 = (13^666-1)/3 and the number of 666 6s is 6*(13^666-1)/12 = (13^666-1)/2.
Their product is (13^666-1)^2/6. This can be expressed as 13^666*[2*(13^666-1)/12] - [2*(13^666-1)/12]
The number in brackets is 666 2s in base 13, and 13^666 is a 1 followed by 666 0s. Then the subtraction has a first number of 666 2s followed by 666 0s and the second number is 666 2s, when both are expressed in base 13.
If we let a=10 and b=11 for base 13 digits, then the difference is 665 2s, followed by one 1, followed by 665 a's, followed by one b. The distinct digits are 1,2,a,b.