You are viewing a single comment's thread. Return to all comments →
def Square_sum(n): MOD = 10**10
total_sum = 0 for i in range(1, n + 1): total_sum = (total_sum + pow(i, i, MOD)) % MOD return total_sum
if name == 'main':
N = int(input()) print(Square_sum(N))
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 →
def Square_sum(n): MOD = 10**10
if name == 'main':