pseudoprimes.frink

Download or view pseudoprimes.frink in plain text format


// This program counts pseudoprimes to several bases

//n = 3317044064679887385961981 + 1 // randomBits[100]*2+1
n = 2
println["n = $n"]

for b = 2 to 65
{
   count = 0
   for a = nextPrime[n] to n + 100 million step 2
      if isStrongPseudoprime[a, b] != isPrime[a]
      {
         count = count + 1
         println["$b\t$a"]
      }

   println["Count of base $b " + (isPrime[b] ? "*" : " " ) + "\t = $count"]      
}


Download or view pseudoprimes.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 19963 days, 22 hours, 12 minutes ago.