Exemplo n.º 1
0
def main():
    num = 1
    while True:
        old_nums = set(num_split(num))
        products = [num*x for x in range(2, 7)]
        tmp = [membership(old_nums, set(num_split(x))) for x in products]
        #print num, tmp, products
        if False not in tmp:
            break
        num += 1

    #print num
    print num
Exemplo n.º 2
0
def main():
    lst = []
    for i in range(100):
        if i % 3 == 2:
            lst.append((i / 3 + 1) * 2)
        else:
            lst.append(1)
    lst[0] = 2
    # print lst
    numerator = cntfrac2frac(lst).numerator
    numbers = num_split(numerator)

    print sum(numbers)
Exemplo n.º 3
0
def sum_digits(num):
    nums = num_split(num)
    return sum(nums)
Exemplo n.º 4
0
def square_chain(num):
    numbers = num_split(num)
    return sum([i ** 2 for i in numbers])