13 lines
249 B
Text
13 lines
249 B
Text
on isSemiPrime (n)
|
|
div = 2
|
|
cnt = 0
|
|
repeat while cnt < 3 and n <> 1
|
|
if n mod div = 0 then
|
|
n = n / div
|
|
cnt = cnt + 1
|
|
else
|
|
div = div + 1
|
|
end if
|
|
end repeat
|
|
return cnt=2
|
|
end
|