Jethro commented on a Page, $isprime() and $iscomposite()  -  Apr 09, 2011

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.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.