Prime & PrimeEx Parameters

Top  Previous  Next

Prime parameters allow you to easily define just prime numbers in a particular range. This allows you to easily ensure that you are only using numbers that have no factors.

 

$p=prime(low,high)

 

Notes:

low and high do NOT need to be prime to use the commands.
The prime command will never return a 1.

 

Examples:

 

$p=prime(1,10)                $p will be chosen from the set {2,3,5,7}.

 

$p=primeex(low,high)

 

You can also use the primeex parameter to include negative numbers.

 

$p=primeex(1,10)                $p will be chosen from the set {-7,-5,-3,-2,2,3,5,7}.