(A,B,C) is a 'pandigital' set of positive integers where the concatenated A|B|C is comprised of all, and only, the ten decimal digits (0 to 9) with no repeated digits. (In the following, except where the base number has a radix, all integers are in base 10.)
How many of these 'pandigital' sets exist for
- AB = C [A in base B equals C]
- AB = C [A to the power of B equals C]
Provide a separate value for each specification.
As any number to the 1st power is itself, B cannot be equal to 1. So, the minimum value of B is 2, which gives us a maximum value for A of 987.
A also cannot equal 1, which would make C equal to 1 for all values of B. Since the minimum value for A is 2, our maximum value for B is 23 (2^23=8388608 .. any higher power and we'd use more than 10 digits)
Running through the following Python code:
for A in range(2,988):
for B in range(2,24):
WORKS=1
C=A**B
STRING=str(A)+str(B)+str(C)
if len(STRING)>10:
WORKS=0
for R in range(0,10):
if STRING.count(str(R))!=1:
WORKS=0
if WORKS==1:
print(A,B,C)
We find that there are
no possible solutions for A, B, and C such that all 10 digits are used, and C = A
B.
|
Posted by Justin
on 2009-12-28 19:53:52 |