This commit is contained in:
David Doblas Jiménez
2021-09-20 17:53:15 +02:00
parent ad6c4e4cd2
commit 7c8165d9c2
50 changed files with 2264 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env python3
"""
Created on 12 Sep 2021
@author: David Doblas Jiménez
@email: daviddoji@pm.me
Solution for problem 48 of Project Euler
https://projecteuler.net/problem=48
"""
from utils import timeit
@timeit("Problem 48")
def compute():
"""
The series, 1^1 + 2^2 + 3^3 + ... + 10^10 = 10405071317.
Find the last ten digits of the series, 1^1 + 2^2 + 3^3 + ... + 1000^1000.
"""
series = sum(i**i for i in range(1,1001))
return str(series)[-10:]
if __name__ == "__main__":
print(f"Result for Problem 48: {compute()}")