Created
July 22, 2021 14:37
-
-
Save igorvanloo/edff4f75c2a70e3f937b903b6a34ea54 to your computer and use it in GitHub Desktop.
Problem 30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These are the fifth power digit sum numbers except the last one is missing | |
#[4150, 4151, 54748, 92727, 93084] | |
def sum_digits_mod(x): | |
totalsum = 0 | |
while x != 0: | |
totalsum += (x % 10)**5 | |
x = x // 10 | |
return totalsum | |
def compute(x): | |
totalsum = 0 | |
for n in range(2,354294): | |
if sum_digits_mod(n) == n: | |
totalsum += n | |
return totalsum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment