Skip to content

Instantly share code, notes, and snippets.

@matinkaboli
Created June 30, 2018 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matinkaboli/e07160db3d938f9d56f782ab909bb69d to your computer and use it in GitHub Desktop.
Save matinkaboli/e07160db3d938f9d56f782ab909bb69d to your computer and use it in GitHub Desktop.
def digitPower(num):
numString = str(num)
su = 0
for j in range(0, len(numString)):
su += int(numString[j]) ** 5
if num == su:
return True
return False
s = 0;
for i in range(2, 100000000):
if digitPower(i):
s += i
print(s)
@matinkaboli
Copy link
Author

This is not the best way. Don't use this.

It will never stop 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment