Created
November 25, 2012 03:18
-
-
Save edalorzo/4142269 to your computer and use it in GitHub Desktop.
Project Euler-Problem #48
This file contains 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
def next_number(stop=1000): | |
n = 1 | |
while n <= stop: | |
yield n ** n | |
n += 1 | |
if __name__ == '__main__': | |
result = str(sum(next_number()))[-10:] | |
print "The last ten digits of the series, 1^1 + 2^2 + 3^3 + ... + 1000^1000 is: %s" % result | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment