summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-05-16 02:28:41 -0500
committerJesse Luehrs <doy@tozt.net>2009-05-16 02:28:41 -0500
commit198cd9dce336d921f504fc11e03fce6ed906aec9 (patch)
treedc88cb4a607351e081ac8a948cbcda2c3dc57a8c
parent7dc32fbe3cd63577e8a8b1a19f7e9ef795da45f4 (diff)
downloadprojecteuler-198cd9dce336d921f504fc11e03fce6ed906aec9.tar.gz
projecteuler-198cd9dce336d921f504fc11e03fce6ed906aec9.zip
solution to 53
-rwxr-xr-x053.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/053.pl b/053.pl
new file mode 100755
index 0000000..3c5b269
--- /dev/null
+++ b/053.pl
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Math::Combinatorics;
+
+my $count = 0;
+for my $n (1..100) {
+ for my $r (0..$n) {
+ my $num = factorial($n)/(factorial($r) * factorial($n - $r));
+ $count++ if $num > 1e6;
+ }
+}
+print "$count\n";