-1

despite searching the web, looking up similiar questions here, and checking my lecture notes, i could not find an answer to my basic problem.

I have the expression:

$$ 264^{245} ≡_p (264\ mod\ p)^{ 245\ mod\ p−1} ,\ p=83 $$

I do not know why i am allowed to pull the mod into the exponent and base. Would someone explain that to me, steer me towards a site, or theorem?

Bill Dubuque
  • 272,048

3 Answers3

-1

The square root of $83$ is a little over $9$, so after trying to divide $83$ by $2,3,5$ and $7$ - it's a prime number.

The reason you can pull the $\text{mod}$ into the base is because reducing $\mod n$ for any positive integer $n$ is a ring homomorphism from $\mathbb{Z}$ to $\mathbb{Z}/n\mathbb{Z}$. As a result, multiplying two integers and then reducing them gives the same result as first reducing each, doing the multiplication and reducing again. (Same for addition BTW.)

The reason you can pull the $\mod (p-1)$ into the exponent for a prime $p$ is because the set of non-zero residues $\mod p$ is an abelian group under multiplication of size $p-1$. It is in fact a cyclic group - though that's not important for this. The (multiplicative) order of any element in it is divisible by $p-1$.

Chad K
  • 4,873
-1

First of all, the specific values don't matter here, so long as $p=83$ is prime. As such, I'm going to let $a=264$ and $n=245$.

Multiplication of (nonzero) integers modulo a prime $p$ forms a group of order $p-1$, so: $$ a^{p-1} \equiv 1 \mod p $$ (This is one multiplication by $a$ away from the usual statement of Fermat's Little Theorem, and so we could have used that fact as well).

So, if we start with the expression $a^{n} \mod p$, we can multiply by $a^{p-1}$ as many times as we wish without changing the value, since it is congruent to the multiplicative identity, $1$. So, we get: $$ a^{n} \equiv a^{n}(a^{p-1})^k\equiv a^{n + k(p-1)}\mod p $$ Since $k$ can be anything, this means that $a^n$ is congruent modulo $p$ to all $a^N$, where $N=n+k(p-1)$. The possible values of $N$ are, by definition, the numbers congruent to $n$ modulo $p-1$.

wwhoss
  • 29
-1

The modular calculations in the base and the exponent are valid for different reasons.

To calculate $$ a^b \pmod{83} $$ you can replace $a$ with its remainder $\pmod{83}$. That works whether or not $83$ is prime (which it is).

Since $83$ is prime, Fermat's little theorem says $$ a^{82} \equiv 1 \pmod{83} $$ (when $a$ is not a multiple of $83$) so if you calculate $b$ modulo $82$ as $$ b = 82q+ r $$ then $$ a^b \equiv a^{82q+ r} \equiv (a^{82})^q a^r \equiv a^r \pmod{83} . $$

Note: I suspect this question is a duplicate on MSE. I couldn't find a good link, so I wrote this answer.

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199