Question: Simplify symbolic powers modulo an integer

I am trying to figure out how to simplify expressions like:

2^(6p+q) mod 3 (where p,q are variables representing integers)

Anybody know how to do this?

Even better would be something that solves 2^n=2 (mod 3) -> n=1 (mod 6)

 

Suggestions?

 

 

 

Please Wait...