Power of prime ending with specified suffix

38 Views Asked by At

I've came across a problem I've got no clue how to tackle. Does such number exist, that it is a power of 7 and it ends with 654321 (gives 654321 modulo 10^6)?

1

There are 1 best solutions below

2
On

Just compute it. The powers of $7 \pmod {10^6}$ cycle with period some factor of $\phi(10^6)=4\cdot 5^5=400000$ If you don't find one within that number of cycles there isn't one. Once you find a cycle you are done.