diff options
| -rw-r--r-- | challenge-156/cheok-yin-fung/perl/ch-2.pl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/challenge-156/cheok-yin-fung/perl/ch-2.pl b/challenge-156/cheok-yin-fung/perl/ch-2.pl index 0410a55139..ef83ce1222 100644 --- a/challenge-156/cheok-yin-fung/perl/ch-2.pl +++ b/challenge-156/cheok-yin-fung/perl/ch-2.pl @@ -19,6 +19,7 @@ if (defined($ARGV[0])) { sub weird { my $num = $_[0]; + return 0 if $num == 1; my @proper_divisors = proper_divisors($num); return 0 if (sum @proper_divisors) < $num; return !subset_sum($num, [@proper_divisors]); |
