Primality by trial division: Difference between revisions

Content added Content deleted
(PascalABC.NET)
 
Line 3,079: Line 3,079:
val chkdiv = fn(n, i) {
val chkdiv = fn(n, i) {
if i * i <= n {
if i * i <= n {
return n ndiv i and self(n, i+2)
return n ndiv i and fn((n, i+2))
}
}
return true
return true