So i want to get a random relatively prime number from a defined range.
I’ve found the individual functions like:
Range[], CoprimeQ[], Select[] and RandomChoise[]. But cant figure out how to combine them.
Lets assume the range is:
r = Range[2,100];
My number to compare if relative prime is:
a=100;
So desired output would be s single random number that is relatively prime to 100 say 77.
My failed attempt looks like this:
RandomChoise[Select[Range[2, 100], CoprimeQ[#, 100] & /@ Range[2, 100]]]