From f401dc2f095502106e652516314e0b3b7533351e Mon Sep 17 00:00:00 2001 From: Apoorva <40395283+appsx13@users.noreply.github.com> Date: Thu, 8 Oct 2020 13:21:52 +0530 Subject: [PATCH] Create project_euler_problem_48.py Solution to Problem 48 of Euler Project --- project_euler_problem_48.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 project_euler_problem_48.py diff --git a/project_euler_problem_48.py b/project_euler_problem_48.py new file mode 100644 index 000000000000..624f9bc3dd56 --- /dev/null +++ b/project_euler_problem_48.py @@ -0,0 +1,13 @@ +# Self powers -> Problem 48 + +# 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 + +def solution(): + total_sum = 0 + for i in range(1,1001): + total_sum += pow(i,i) + total_sum = str(total_sum) + print(str(total_sum)[-10:]) + +solution()