Created
December 10, 2011 17:18
-
-
Save jakedobkin/1455632 to your computer and use it in GitHub Desktop.
Euler 48 Python: Exponential sum series
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
| # http://projecteuler.net/problem=48. | |
| n = 1000 | |
| sum = 0 | |
| for i in range (1,n+1): | |
| sum += i**i | |
| print str(sum)[-10:] | |
| # python makes this trivial- but for a language that can't deal with large numbers, | |
| # i think http://en.wikipedia.org/wiki/Exponentiating_by_squaring is probably how you'd do it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment