It's the same for 3.
The theory is fairly simple. If you start with modulo 5, there are only 4 possible answers for relatively prime numbers (numbers not divisible by 5 in this case). So if you're looking at powers, it will start repeating after 4 consecutive powers. (For two it would be 1,2,4,3,1,2,4,3, or make it 10 and you get 1,2,4,8,6,2,4,8,6)
Now with 25 (5 squared), you'll find that there are only 20 relatively prime numbers to look at, which means only 20 possiblities before it repeats itself.. (5,10,15,and 20 are all divisble by 5).
With 125 (5 cubed), you see 100 relatively prime modulos, which is 5 times what you had with 25, which is 5 times what you had with 5 itself, so that pattern becomes obvious.