Python,C,C++ and JAVA programs for CBSE, ISC, B.Tech and I.T Computer Science and MCA students

The Programming Project: Self powers : Problem 48 Euler Project

Sunday, September 7, 2014

Self powers : Problem 48 Euler Project

Self powers : Problem 48 Euler Project

The series, 11 + 22 + 33 + ... + 1010 = 10405071317.
Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.

Python Code

def selfPower():
     sumT = 0
     for i in range(1000):
             i = i+1
             sumT = sumT + (i**i)%10000000000
     print "last ten digits of the sum:",sumT%10000000000
selfPower()



No comments:

Post a Comment