- or download this
my $N = shift;
my $sqrt = sqrt( $N );
...
return 1 if @factor == 1;
# ... rest of the code
return $f < $sqrt ? $f : undef;
- or download this
my $N = shift;
my $sqrt = sqrt( $N );
...
return 1 if @factor == 1;
# ... rest of the code
return $f < $sqrt ? $f : undef;
- or download this
my $N = shift;
my @factor = prime_factors( $N );
...
return 1 if @factor == 1;
# ... rest of the code
return $f;