primesInPi.frink

Download or view primesInPi.frink in plain text format

str = read["file:pi1000000.txt"]
str =~ %s/[^\d]//g   // Strip out any non-digits

// Largest known is 78073
// "there are no others with n <= 79718"
// http://mathworld.wolfram.com/Pi-Prime.html
// https://oeis.org/A060421
for len = 79715 to length[str]
{
   s = left[str, len]
   if isPrime[parseInt[s]]
   {
      println["\n*$len\t$s"]
      exit[]
   } else
      print["$len "]
}


Download or view primesInPi.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20136 days, 3 hours, 20 minutes ago.