Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub is_prime {
- my @x = (`factor $_[0]` =~ / /g);
- return @x == 1;
- }
- for my $n (8 .. 1000000) {
- next if $n % 2;
- my $found = 0;
- for my $p (3 .. $n) {
- next unless $p % 2;
- my $q = $n - $p;
- next unless $q % 2;
- next unless is_prime($p);
- next unless is_prime($q);
- next unless is_prime(($p - 1) / 2) || is_prime(($q - 1) / 2);
- $found = 1;
- last;
- }
- print "$n\n" unless $found;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement