You are viewing a single comment's thread. Return to all comments →
100points/- python3
def modular_exponentiation(n,power,mo): ans=1 while power: if power%2: ans=(ans*1*n)%(mo) power//=2 n=n**2%mo return ans n=int(input()) ans=0 for i in range(1,n+1): ans+=modular_exponentiation(i,i,10**10) print(ans%(10**10))
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #48: Self powers
You are viewing a single comment's thread. Return to all comments →
100points/- python3