p048.py 358 Bytes
Newer Older
1 2
# 
# Solution to Project Euler problem 48
3
# Copyright (c) Project Nayuki. All rights reserved.
4
# 
5
# https://www.nayuki.io/page/project-euler-solutions
6 7 8 9 10 11 12 13 14 15 16 17
# https://github.com/nayuki/Project-Euler-solutions
# 


def compute():
	MOD = 10**10
	ans = sum(pow(i, i, MOD) for i in range(1, 1001)) % MOD
	return str(ans)


if __name__ == "__main__":
	print(compute())