Determine the maximum value of a positive prime N, such that none of the digits in the base ten representation of N2 occur more than once.
I found the maximum N of 21397 which gives N^2 of 457831609
using the following code
mx=N[Sqrt[9876543210]];
i=1;
p=Prime[i];
While[p„Tmx,
dgs=IntegerDigits[p^2];
If[Length[dgs]ƒúLength[Union[dgs]],
Print[p," ",p^2];
];
i++;
p=Prime[i];
];
|
Posted by Daniel
on 2009-05-30 13:01:42 |