Coprime and CoprimeEx Parameters |
Top Previous Next |
Coprime parameters allow you to access sets of coprime numbers. This allows you to quickly create lists of numbers which share no common factors.
$p=coprimes(low,high) $p=coprimesex(low,high)
Notes:
Examples:
$p=coprimes(2,10) $p will be a random set of AT MOST 4 coprime numbers. It might return {6,5,7} or {4,9,7,5}. $p=coprimesex(2,100) $p will be a random set of 10 coprime numbers. It might return {27,-8,-73,49,-97,71,-41,59,-65,11} or {-67,-5,12,73,-97,31,-89,13,-83,-7}
Using Coprime ParametersIf you just use the parameter $p, you will have the full list of coprimes inserted into your equation. Normally, you will instead use references to the individual numbers.
$p[1] and $p[2] are coprime
might return
6 and 5 are coprime.
You can confidently use $p[1], $p[2] and $p[3] in most situations. If you have a small range of numbers available, going beyond this can result in undefined references |