예제 #1
0
def problem007():
    """prime number theorem says # primes < n = n / ln n + B, B = 1.0836 --> nPrimes ~ n / ln n
    Solving in reverse: e^(-1 *  ProductLog(-1, -(1/a))) --> a ~ 116684
    """

    n = 10001
    r = range(116684)
    print r[-1]
    l = tools.filter_primes(r)
    print l[n]
예제 #2
0
def problem010c():
    l = tools.filter_primes(range(2,limit))
    print sum(l)