def validPair(primes, maxprime, p1, p2): x = int(p1 + p2) y = int(p2 + p1) if x > maxprime: if not libeuler.isPrime(x): return False else: if x not in primes: return False if y > maxprime: if not libeuler.isPrime(y): return False else: if y not in primes: return False return True
def main(): num = 1 diagprimes = 0 total = 1 x = 0 avg = 1 while avg > .1: x += 2 for i in range(3): num += x total += 1 if libeuler.isPrime(num): diagprimes += 1 num += x total += 1 avg = diagprimes / total print(x+1)