Skip to content

Instantly share code, notes, and snippets.

@warpgate3
Created March 23, 2018 02:41
Show Gist options
  • Save warpgate3/c6cc494123ec21c296a12f0c4ae4a995 to your computer and use it in GitHub Desktop.
Save warpgate3/c6cc494123ec21c296a12f0c4ae4a995 to your computer and use it in GitHub Desktop.
find self number under 5000
def generateNum(inputNumber):
sumResult = 0
for n in str(inputNumber):
sumResult = sumResult + int(n)
return sumResult + inputNumber
ORIGIN = set(range(1,5001))
FILTER = set([generateNum(n) for n in range(1, 5001)])
print(sum(ORIGIN - FILTER))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment