How would I generate a random number coprime to another?

This is for a graph I am working on for Pallier encryption

this uses a ticker …
https://www.desmos.com/calculator/agrwsefldo

this instead uses a direct approach (no Ticker) but it’s a bit more complex:
https://www.desmos.com/calculator/tdaxhbcgwh

It is made in such a way that all the numbers that are coprime with the given number
have the same probability of being picked ..

Sorry if I seem like I’m intruding, I just saw this and was really interested in this question.
I’ve never seen random( ) passed without an argument! Does it act differently if you were to pass it with a range?

Here’s the documentation on the various uses of the random function:
https://help.desmos.com/hc/en-us/articles/4405633253389-Statistics#h_01FB2RSKNB6NT6P03Y9MXA0VX5

Ohhhhhhh!!! Interesting, seems like random is default to generate between 0 and 1.

Cool! I didn’t know that before.

Just curious but why do you need the coprimes?

oop sorry Guzman if this went to your email I meant to reply the post with through my email

… no worries … :slight_smile: (some random words to fill the post)

1 Like