Determine all possible values of a duodecimal (base 12) positive integer N less than 100,000 (base 12), such that N is obtained by multiplying the sum of its digits with the sum of squares of its digits.
Prove that these are the only possible values of N that exist.
The numbers in base 12 are 1, 335 and 805.
digits in base 12 decimal equivalent
0 0 0 0 0 0 1 1
0 0 0 0 3 3 5 473
0 0 0 0 8 0 5 1157
DEFDBL A-Z
CLS
DO
n = n + 1
FOR p = 0 TO 7
d(p) = d(p) + 1
IF d(p) < 12 THEN EXIT FOR
d(p) = 0
NEXT
IF d(7) > 0 THEN EXIT DO
sum = d(0) + d(1) + d(2) + d(3) + d(4) + d(5) + d(6)
sumsq = d(0) * d(0) + d(1) * d(1) + d(2) * d(2) + d(3) * d(3) + d(4) * d(4) + d(5) * d(5) + d(6) * d(6)
IF sum * sumsq = n THEN
FOR p = 6 TO 0 STEP -1
PRINT d(p);
NEXT p
PRINT TAB(30); n
END IF
LOOP
For a base-12 number L digits long, the least the number can be is 12^(L-1). The sum of the digits is at most 11*L and the sum of the squares is at most 121*L, and the product of those two sums is at most 1331*L^2.
While 12^(L-1) increases exponentially, 1331*L^2 is only polynomial, so the former overtakes and exceeds the latter at a certain point:
number of digits least possible number greatest possible product of sums
(decimal) (decimal)
1 1 1331
2 12 5324
3 144 11979
4 1728 21296
5 20736 33275
6 248832 47916
7 2985984 65219
8 35831808 85184
9 429981696 107811
10 5159780352 133100
So by the time you get to 6-digit base-12 numbers, the least possible value of the number, 248,832 in decimal, exceeds the greatest possible product of the stated sums, which is 47,916 in decimal.
|
Posted by Charlie
on 2010-12-07 15:18:32 |