From 0be427137c69908a4891c46becaecb77da9351c6 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Wed, 28 Apr 2010 17:18:51 +0000 Subject: [PATCH] Problem 048 git-svn-id: file:///srv/svn/euler@55 e5f4c3ec-3c0c-11df-b522-21efaa4426b5 --- e048.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 e048.py diff --git a/e048.py b/e048.py new file mode 100644 index 0000000..6f19eaa --- /dev/null +++ b/e048.py @@ -0,0 +1,11 @@ +def powerseries(n): + i = 1 + total = 0 + while i <= n: + total = total + i**i + i = i + 1 + return total + +if __name__ == '__main__': + val = str(powerseries(1000)) + print 'Last 10:', val[-10:]