Carmichael 3 strong pseudoprimes: Difference between revisions

Content added Content deleted
Line 2,060: Line 2,060:
func isprime(num)
func isprime(num)
if (num <= 1) return 0 ok
if (num <= 1) return 0 ok
if (num % 2 = 0) and num != 2
if (num % 2 = 0) and num != 2
return 0
return 0
ok
ok
for i = 3 to floor(num / 2) -1 step 2
for i = 3 to floor(num / 2) -1 step 2
if (num % i = 0)
if (num % i = 0)
return 0
return 0
ok
ok
next
next
return 1
return 1
</lang>
</lang>
Output:
Output: