from primeGen import primes2 PRIMELST = primes2(7071) result = set() for num1 in PRIMELST: for num2 in PRIMELST: for num3 in PRIMELST: temp = num1 * num1 + num2 ** 3 + num3 ** 4 if temp < 5e7: result.add(temp) print len(result)
# #UNSOLVED! from primeGen import primes2, FermatPrimalityTest PRIMELST = set(primes2(10000)) print len(PRIMELST) def prop(lst): for num1 in lst: for num2 in lst: a = int(str(num1) + str(num2)) b = int(str(num2) + str(num1)) if a != b: if not FermatPrimalityTest(a): return False elif not FermatPrimalityTest(b): return False else: # print 'quitting', a, b continue return True # print 'test' # print prop([3, 7, 109, 673]) result = float('inf') for num1 in PRIMELST: for num2 in PRIMELST: if num1 != num2: if prop([num1, num2]): for num3 in PRIMELST:
from primeGen import primes2 def pand(n): return sorted(str(n)) == [str(n) for n in range(1, len(str(n)) + 1)] primelst = primes2(100000000) # primesset = set(primes) largest = 0 print 'starting loop' for num in primelst: if pand(num): largest = num print largest
from primeGen import primes2 PRIMELST = primes2(1000000) def primeDivisors(number, divisors): result = 0 for num in PRIMELST: if number % num == 0: result += 1 if num > (number / 2.): break if result == divisors: return True return False x = 1 y = 2 z = 3 b = 4 while True: if primeDivisors(x, 4) and primeDivisors(y, 4) and primeDivisors(z, 4) and primeDivisors(b, 4): print x, y, z, b break x += 1 y += 1 z += 1 b += 1