Determine the maximum value of a duodecimal prime number N, such that none of the digits in the base 12 representation of N
2 occur more than once.
N = 846977
N^2 = 717370038529
Base 12: B7045936281
-----------
for n in range(12**6 - 1 , 0 , -2):
if not isprime(n):
continue
s = n**2
x = base2base(s,10,12)
if len(x) == len(set(x)):
print(n, s, x)
break
|
Posted by Larry
on 2024-07-03 00:17:06 |