diff --git a/src/Python/Problem048.py b/src/Python/Problem048.py new file mode 100644 index 0000000..19ca3d2 --- /dev/null +++ b/src/Python/Problem048.py @@ -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()}") \ No newline at end of file