primechain2.frink

Download or view primechain2.frink in plain text format

/** Generates left-truncatable primes */
nums = [3, 5, 7]

while length[nums] > 0
{
   nums2 = new array
   
   for n = nums
   {
      for p = 1 to 9
      {
         n2 = parseInt["$p$n"]
         if isPrime[n2]
            nums2.push[n2]
      }
   }

   nums = nums2
   println[nums]
}
   
      


Download or view primechain2.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, eliasen@mindspring.com