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.