Created
October 13, 2010 13:57
-
-
Save colomon/624075 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub is-prime($a) { | |
return Bool::True if $a == 2; | |
! [||] $a <<%%<< (2, 3, *+2 ... * > $a.sqrt); | |
} | |
my @fib := (1, 1, *+* ... *); | |
my $least-prime = (@fib ... { $^a > 227000 && is-prime($a) })[*-1]; | |
my $x = $least-prime + 1; | |
say [+] (2, 3, *+2 ... * > $x.sqrt).grep({ $x %% $^a && is-prime($a) }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment