Skip to content

Commit 46b4e51

Browse files
Solution to Problem 48
1 parent 81dc221 commit 46b4e51

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Project Euler/Problem 48/sol1.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from __future__ import print_function
2+
'''
3+
Self Powers
4+
Problem 48
5+
6+
The series, 11 + 22 + 33 + ... + 1010 = 10405071317.
7+
8+
Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.
9+
'''
10+
11+
try:
12+
xrange
13+
except NameError:
14+
xrange = range
15+
16+
total = 0
17+
for i in xrange(1, 1001):
18+
total += i**i
19+
20+
21+
print(str(total)[-10:])

0 commit comments

Comments
 (0)