- Repeat⁵: - If $2^{(r-1)/2}\bmod r$ is $1$ or $r-1$ (that is, $r$ pass the Euler test to base $2$): - Test if $r$ is primeprime⁶, using e.g. a small number of strong pseudoprime⁶pseudoprime⁷ tests to random base, and if so: - Output $r$ and stop. - If $r<r_2$: $r\gets r+r_0$; else: $r\gets r-r_1$.