ArnaultTest.frink

Download or view ArnaultTest.frink in plain text format


/** This tests Frink's primality-testing routines against the numbers
   described in the paper: 

   Constructing Carmichael Numbers which are Strong Pseudoprimes to Several
   Bases, François Arnault, Journal of Symbolic Computation, Volume 20, Issue
   2, August 1995, Pages 151–161

   https://www.sciencedirect.com/science/article/pii/S0747717185710425
*/


p1 = 29674495668685510550154174642905332730771991799853043350995075531276838753171770199594238596428121188033664754218345562493168782883

p2 = (313 (p1-1) + 1)
p3 = (353 (p1-1) + 1)

n = p1 p2 p3

["p1 = $p1"]
println[]
println["p2 = $p2"]
println[]
println["p3 = $p3"]
println[]
println["n = p1 p2 p3 = $n"]
println[]
println[length[toString[n]]]


println[isPrime[n]]

b = 1
do
{
   b = nextPrime[b]
   if isStrongPseudoprime[n,b]
      println["Fooled by base $b"]
} while b < 4000



/*for b = 1 to 4000
   println["$b\t" + isStrongPseudoprime[n,b]]*/


Download or view ArnaultTest.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 20139 days, 6 hours, 13 minutes ago.