Exemple #1
0
def main():
    correct_numbers = []
    for i in range(2, 1000000):
        if i == sum(x**POWER for x in helpers.int_to_digits(i)):
            correct_numbers.append(i)

    print(correct_numbers)

    answer = sum(correct_numbers)
    print(answer)
Exemple #2
0
def is_curious(n):
    return n == sum(factorial(x) for x in helpers.int_to_digits(n))
Exemple #3
0
def main():
    answer = max(
        sum(helpers.int_to_digits(a**b)) for a in range(100)
        for b in range(100))
    print(answer)
Exemple #4
0
def main():
    answer = sum(helpers.int_to_digits(2**1000))
    print(answer)
def main():
    factorial = math.factorial(100)
    answer = sum(helpers.int_to_digits(factorial))
    print(answer)