summaryrefslogblamecommitdiffstats
path: root/053.pl
blob: 3c5b2692743a08f7e572ecfb9e2496ee189f0961 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
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";