Chernick's Carmichael numbers: Difference between revisions
→{{header|Go}}: Changed argument to ProbablyPrime function to 0. Almost halves run time (now 3.5s).
(added Carmichael 3 strong pseudoprimes as related task) |
(→{{header|Go}}: Changed argument to ProbablyPrime function to 0. Almost halves run time (now 3.5s).) |
||
Line 87:
func ccFactors(n, m uint64) (*big.Int, bool) {
prod.SetUint64(6*m + 1)
if !prod.ProbablyPrime(
return zero, false
}
fact.SetUint64(12*m + 1)
if !fact.ProbablyPrime(
return zero, false
}
Line 97:
for i := uint64(1); i <= n-2; i++ {
fact.SetUint64((1<<i)*9*m + 1)
if !fact.ProbablyPrime(
return zero, false
}
|