- 問題
Problem 48:Self powers
The series, 1^1 + 2^2 + 3^3 + ... + 10^10 = 10405071317.Find the last ten digits of the series, 1^1 + 2^2 + 3^3 + ... + 1000^1000.
- 解答例
sum = 0 for i in range(1, 1001): sum += i ** i tempStr = str(sum) print(tempStr[len(tempStr) - 10::])