strongPseudoprimeTest.frink

View or download strongPseudoprimeTest.frink in plain text format


/** This tests strong pseudoprime algorithms with limited bases.

    see http://miller-rabin.appspot.com/
*/

a = 9345883071009581737
//a = 921211727
//a = 377687
//a = 2
a = [2, 299417]
//a = [2346211568, 3056093627]
a = [11000544, 31481107]
a = [2, 325, 9375, 28178, 450775, 9780504, 1795265022]  // Sinclair's numbers, found to be good to "at least 2^64"

n = 2^64-1
while isStrongPseudoprime[n, a] == isPrime[n]
{
   n = n + 2
}
println["Error at $n"]


View or download strongPseudoprimeTest.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 18354 days, 1 hours, 30 minutes ago.