Each of A, B, and C is a different
zeroless pandigital number that satisfy this equation:
A*B=C2
Determine the minimum value of C.
The minimum value for 'C' I found was
231597684A: 164938572
B: 325196748
C: 231597684
A*B = C^2 = 53637487234163856
-----------
digs = '123456789'
pandigitals = []
squares = []
from itertools import permutations
for perm in permutations(digs):
apan = int(''.join(perm))
pandigitals.append(apan)
squares.append(apan**2)
pandigitals.sort()
squares.sort()
solutions = []
found = False
for s in squares:
c = int(s**.5)
for a in pandigitals:
if a > c:
break
b = s/a
if a == b:
continue
if b%1 != 0:
continue
if int(b) in pandigitals:
print(a,int(b),c,s)
solutions.append([a,int(b),c,s])
found = True
if found:
break
|
Posted by Larry
on 2023-01-06 10:45:51 |