I would like to understand who it works the modulo with Straightforward method. For example I try to test this: 290 mod 1009 = 257^x mod 1009. Which is the "x"?
1 attempt --> 1*257 mod 1009 = 257
2 attempt --> 257*257 mod 1009 = 464
3 attempt --> 464*257 mod 1009 = 186
4 attempt --> 186*257 mod 1009 = 379
5 attempt --> 379*257 mod 1009 = 539
6 attempt --> 290*257 mod 1009 = 290
Therefore x=6. 290 mod 1009 = 257^6 mod 1009.
I can't understand how in 3 attempt the 464*257=119248 gives the same modulo with 257^3=16974593.