Project Euler 48-Self powers

内容目录

Self powers

Problem 48

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

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

 

Answer:
9110846700
Completed on Fri, 5 Apr 2013, 12:33

Go to the thread for problem 48 in the forum.

 

ans=0
i=1
F=10**10
for i in range(1,1001):
p=1
for j in range(i): p=p*i%F
ans=(ans+p)%F
print i
print ans