From 46b4e51d6e027905a3ae1530dc0dfbfee644ab91 Mon Sep 17 00:00:00 2001 From: Daniel Ingram Date: Sun, 18 Mar 2018 13:59:01 -0400 Subject: [PATCH] Solution to Problem 48 --- Project Euler/Problem 48/sol1.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Project Euler/Problem 48/sol1.py diff --git a/Project Euler/Problem 48/sol1.py b/Project Euler/Problem 48/sol1.py new file mode 100644 index 000000000..5c4bdb0f6 --- /dev/null +++ b/Project Euler/Problem 48/sol1.py @@ -0,0 +1,21 @@ +from __future__ import print_function +''' +Self Powers +Problem 48 + +The series, 11 + 22 + 33 + ... + 1010 = 10405071317. + +Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000. +''' + +try: + xrange +except NameError: + xrange = range + +total = 0 +for i in xrange(1, 1001): + total += i**i + + +print(str(total)[-10:]) \ No newline at end of file