You can use regex to check for prime numbers:
alias isprime {
return $+($,$iif($regex($str(1,$1),/^1?$|^(11+?)\1+$/),false,true))
}
For the iscomposite alias, you can use $iif() to shrink it a bit:
alias iscomposite {
return $+($,$iif($isprime($1) == $true,false,true))
}
Note that I didn't make the regex pattern. I've applied it to mIRC.