diff options
Diffstat (limited to '008/ch1.pl')
-rwxr-xr-x | 008/ch1.pl | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,10 +1,14 @@ #!/usr/bin/env perl +# +# Write a script that computes the first five perfect numbers. A perfect number +# is an integer that is the sum of its positive proper divisors (all divisors +# except itself). +# (https://en.wikipedia.org/wiki/Perfect_number) +################################################################################ use strict; use warnings; -my @primes; - sub perfect { my $sum = 0; my $n = shift; |