Created
April 13, 2012 13:30
-
-
Save moritz/2376843 to your computer and use it in GitHub Desktop.
find the first 7-digit palindromic substring of pi that is als a prime
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
use 5.014; | |
use Math::Prime::XS qw/is_prime/; | |
while (qx/pi 100000/ =~ /.(?=((\d)(\d)(\d).\4\3\2))/g) { | |
say $1 if is_prime($1); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment