Solution (source code)

= Solution

The powers of $3$ modulo $10$ are
$$
3^0,3^1,3^2,3^3,3^4\equiv1,3,9,7,1\pmod{10}.
$$
They then repeat, and none of the first three positive exponents returns $1$. Hence \b[the least period is $\boxed{r=4}$.]