diff options
author | kartofen <mladenovnasko0@gmail.com> | 2023-04-12 23:33:50 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2023-04-12 23:33:50 +0300 |
commit | 8270ca448dd86517468872d9fc26f0f5d402864a (patch) | |
tree | d55590d4e1812a0d31e2fdb69668b78352eab950 /main.py |
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -0,0 +1,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); |