Create a gist now

Instantly share code, notes, and snippets.

find the first 7-digit palindromic substring of pi that is als a prime
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