I'm asked to find a primitive root modulo powers of odd primes. I have to write a program that calculates but I'm having a hard time coming up with an algorithm that will calculate this.

For example, let our odd prime be 5. How would I find a primitive root of, say 5^3?

Thanks