For testing a particular algorithm I found mathematica is the best way as it has all the tools I need. I am stuck in a number theory part and since I am not an expert in mathematica I do not know how to write a code that seemingly involves loops. I want to pick random integers $a,b$ in interval $[T,2T]$ at $T>0$ and obtain $u,v\in\mathbb Z$ such that
$au-bv=1$ (Euclidean algorithm)
$au+bv$ is a prime
Is there simple enough code to do this?
It would help me to have 5. $a,b,u,v$ are all prime integers.
FindInstancefunction without any loops. $\endgroup$
u,vneed not exist. Are you wanting code that will keep picking random
a,buntil you get a pair for which they do exist? $\endgroup$
a,b,u,vsought or just, as it was worded,
u and v? (2) Loops, should you wish to use them explicitly, can be accomplished with any of
While. Same as in other languages. $\endgroup$