Problem 48 Self powers

2016-11-11 10:38:00   技术   python projecteulor

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\).

result = 0
for i in range(1, 1001):
    result += i**i

print str(result)[-10:]

python你是超级大妖怪不解释

评论已关闭。
评论共