fcn semiprime(n){ reg f = 0; p:=2; while(f < 2 and p*p <= n){ while(0 == n % p){ n /= p; f+=1; } p+=1; } return(f + (n > 1) == 2); }