Problem with a loop in Mathematica

70 Views Asked by At

I am trying to create a loop in Mathamtica, where i get all $i$'s (with a certain bound, of course) for which the following expression holds: $7^{41\ast i}\equiv 3^{41}\, mod\, p$, where $p$ is just some number. I tried to use $while$, but it didn't work. :( Can anybody help me? Is it possible to calculate this?

Thank you in advance!

1

There are 1 best solutions below

0
On

Try

p = 5;
modTarget = Mod[3^41, p];
Select[Range[1000], Mod[7^(41 #), p] == modTarget &]