Exemple #1
0
def largest_factor(num):
    return max(j for j in factor_num(num))
Exemple #2
0
def scratch(up_to_n):
    prime_list = [p for p in primes(int((up_to_n + 1) ** 0.5) + 1)]
    t0 = time.time()
    for j in xrange(2, up_to_n, 4):
        if is_special(j, prime_list):
            print(j, list(factor_num(j)))
def test_factor_nums():
    big_num = reduce(lambda j, k: j * k, small_primes)
    factors = sorted(list(factor_num(big_num)))
    assert_list_equal(factors, list(small_primes))