def leftTrunc(n): if str(n)[1:] == '': return ansr else: if ef.isPrime(n): if ef.isPrime(int(str(n)[1:])): ansr.append(True) return leftTrunc(int(str(n)[1:])) else: ansr.append(False) return [0] else: return [0]
def rightTrunc(n): if str(n)[1:] == '': return ansl else: if ef.isPrime(n): if ef.isPrime(int(str(n)[:-1])): ansl.append(True) return rightTrunc(int(str(n)[:-1])) else: ansl.append(False) return [0] else: return [0]
def compute(): ans = [2, 3] a = 5 while a <= 2000000: if ef.isPrime(a): ans.append(a) a += 2 # print((ans)) else: a += 2 return sum(ans)
def compute(): ans = [2, 3] a = 5 while len(ans) <= 10000: if ef.isPrime(a): ans.append(a) a += 2 # print((ans)) else: a += 2 return max(ans)
#!/usr/bin/env python from eulerfuncs import isPrime if __name__ == '__main__': primes = [2] n = 3 while len(primes) < 10001: if isPrime(n): primes.append(n) n += 2 print(primes[10000])
def countPrimes(a, b): for n in count(0): if not isPrime(n**2 + a*n + b): return n