The series, 11 + 22 + 33 + ... + 1010 = 10405071317.
Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.
Naive solution.
But I wonder if there is any clever solution, since in other programming languages, high-order power might exceed integer limit.
def solve(bound, last_digits_number):
s = sum(map(lambda i: pow(i, i), range(1, bound+1)))
return s % pow(10, last_digits_number)
solve(10, 10)
solve(100, 10)
solve(1000, 10)