filter.pl 209 B

123456789101112131415
  1. #!/usr/bin/perl
  2. use 5.014;
  3. use Math::Prime::Util::GMP qw(sigma);
  4. while (<>) {
  5. next if /^\h*#/;
  6. /\S/ or next;
  7. my $n = (split(' ', $_))[-1];
  8. if (sigma($n)/$n >= 1.7) {
  9. say $n;
  10. }
  11. }