Skip to content

Instantly share code, notes, and snippets.

@igorvanloo
Created July 22, 2021 14:37
Show Gist options
  • Save igorvanloo/edff4f75c2a70e3f937b903b6a34ea54 to your computer and use it in GitHub Desktop.
Save igorvanloo/edff4f75c2a70e3f937b903b6a34ea54 to your computer and use it in GitHub Desktop.
Problem 30
# 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