source code for "files/pe/pe_003.pl"
return to portfolio
- #!/usr/bin/perl
- use strict;
- use warnings;
- my ($k, $root, $n) = (3, int sqrt(600851475143), 600851475143);
- for ($k=3; $k < $root; $k++)
- {
- if ($n%$k == 0)
- {
- $n/=$k;
- $root = int sqrt $n;
- }
- }
- print $n;