#!/usr/bin/env python # Author: Sean B. Palmer, inamidst.com # License: LGPL, share and enjoy! # About: http://inamidst.com/proj/primes/about from mathfun import isprime primes = [2, 3, 5, 7] done = 0 while True: if len(primes) == 1: break first, primes = primes[0], primes[1:] for digit in '123456789': n = int(digit + str(first)) if isprime(n): primes.append(n) done += 1 if (done % 100) == 0: print 'done:', done, primes[-1] print primes[0]