def solve002(limit, start_with_two_ones): fibonacci = NumberTheory.fibonacci_under(limit, start_with_two_ones) even_fibonacci = list() for num in fibonacci: if NumberTheory.is_factor_of(2, num): even_fibonacci.append(num) return sum(even_fibonacci)
def solve007(limit): return max(NumberTheory.first_primes(limit))
def solve005(limit): return NumberTheory.smallest_multiple(limit)
def solve003(limit): factors = NumberTheory.prime_factors_of(limit) return max(factors)
def solve001(factors, multiple): return NumberTheory.sum_of_multiples_under(factors, multiple)
def solve024(n): list_ = list(range(10)) permutation = NumberTheory.nth_permutation(n, list_) permutation = [str(x) for x in permutation] return "".join(permutation)
def solve021(num): divisors = NumberTheory.proper_divisors(num) return sum(divisors)
def solve014(limit): iterations = NumberTheory.collatz_iterations_under(limit) return General.key_with_max_value(iterations)
def solve012(limit): num = 2 while NumberTheory.num_factors_of(Basic.sum_up_to(num)) <= limit: num += 1 return Basic.sum_up_to(num)
def solve010(limit): primes = NumberTheory.primes_under(limit) return sum(primes)