diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-05-16 02:28:41 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-05-16 02:28:41 -0500 |
commit | 198cd9dce336d921f504fc11e03fce6ed906aec9 (patch) | |
tree | dc88cb4a607351e081ac8a948cbcda2c3dc57a8c | |
parent | 7dc32fbe3cd63577e8a8b1a19f7e9ef795da45f4 (diff) | |
download | projecteuler-198cd9dce336d921f504fc11e03fce6ed906aec9.tar.gz projecteuler-198cd9dce336d921f504fc11e03fce6ed906aec9.zip |
solution to 53
-rwxr-xr-x | 053.pl | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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"; |