Problem 48 : Self powers

Problem Statement

The series, 11 + 22 + 33 + … + 1010 = 10405071317.

Find the last ten digits of the series, 11 + 22 + 33 + … + 10001000.

Solution

sum1=0

for i in range(1,1000+1):
    sum1=sum1+(i**i)

val=str(sum1)
val=val[::-1]

print(int(val[0:10][::-1]))

Output

9110846700