Example #1
0
import math, euler
primeTest = euler.primeGen(10000)
primes = [x for x in range(len(primeTest)) if primeTest[x]]
oddComps = [x for x in range(len(primeTest)) if not primeTest[x] and x % 2 and x > 3]
for oddComp in oddComps:
    flag = False
    for prime in primes:
        if oddComp > prime:
            temp = math.sqrt((oddComp - prime)/2)
            if temp == int(temp):
                flag = True
                break
        else:
            break
    if flag == False:
        print(oddComp)
        break
Example #2
0
import euler
primes = euler.primeGen(7654321)
primeList = [x for x in range(len(primes)) if primes[x]]
for prime in reversed(primeList):
    print(prime)
    if euler.isPandigital(prime):
        break
print(prime)
    
Example #3
0
import euler

primes = euler.primeGen(7654321)
primeList = [x for x in range(len(primes)) if primes[x]]
for prime in reversed(primeList):
    print(prime)
    if euler.isPandigital(prime):
        break
print(prime)