def problem_47(): set_list = [] set_list_len = 4 current_num = 5 #kind of arbitrary while(True): c = collections.Counter(utils.prime_factorize(current_num)) new_set = set() for key, value in c.iteritems(): new_set.add(key**value) set_list.append(new_set) if len(set_list) > set_list_len: set_list.pop(0) lengths = [len(s) == set_list_len for s in set_list] if len(set.intersection(*set_list)) == 0 and all(lengths): return set_list, current_num - set_list_len + 1 current_num += 1
def problem_47(): set_list = [] set_list_len = 4 current_num = 5 #kind of arbitrary while (True): c = collections.Counter(utils.prime_factorize(current_num)) new_set = set() for key, value in c.iteritems(): new_set.add(key**value) set_list.append(new_set) if len(set_list) > set_list_len: set_list.pop(0) lengths = [len(s) == set_list_len for s in set_list] if len(set.intersection(*set_list)) == 0 and all(lengths): return set_list, current_num - set_list_len + 1 current_num += 1
def problem_3(): return utils.prime_factorize(600851475143)[-1]