Problem 41: We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also prime.
What is the largest n-digit pandigital prime that exists?
class runner
{
private static boolean isPrime(int n){
for(int i=2; i
Note1:
limit = 9 -> 404ms;
limit = 7 -> 43ms;
The limit is 7 as [1+..+8] is divisible by 3, as is [1+..+9]
Note2: The prime check could probably be optimized.