summaryrefslogtreecommitdiff
path: root/main.py
blob: 43f0e01ab9649569025aeedb2643a24427736e52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def sum_digits(n):
    s = 0
    while n:
        s += n % 10
        n //= 10
    return s

n = 0
dig_sum = sum_digits(n)
for i in range(3):
    n = n*10 + 9;

    for i in range(1, 200):
        power = pow(n, i);
        print(n, "^", i, "=", power, ';', sum_digits(power), power % 9);