summaryrefslogtreecommitdiffstats
path: root/028.pl
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-05-18 00:18:51 -0500
committerJesse Luehrs <doy@tozt.net>2009-05-18 00:18:51 -0500
commit0ad4417f2a736d7b12076ec0a2ba7e722f574542 (patch)
tree01ae4c5dbd08c30e96ab5b86f087611c1d33b532 /028.pl
parent37c4f77fe7c41603b9410728ccd53b9021749717 (diff)
downloadprojecteuler-0ad4417f2a736d7b12076ec0a2ba7e722f574542.tar.gz
projecteuler-0ad4417f2a736d7b12076ec0a2ba7e722f574542.zip
solution to 28
Diffstat (limited to '028.pl')
-rwxr-xr-x028.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/028.pl b/028.pl
new file mode 100755
index 0000000..64d8dee
--- /dev/null
+++ b/028.pl
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+my $n = 1;
+my $total = $n;
+for my $i (1..500) {
+ for my $j (1..4) {
+ $n += 2 * $i;
+ $total += $n;
+ }
+}
+print "$total\n";