How to simplify this alternating modulo expression?

875 Views Asked by At

The value of $(1000^i \mod 7)$ alternates between 1 and 6, as such:

$$ 1000^0 \mod 7 = 1 $$ $$ 1000^1 \mod 7 = 6 $$ $$ 1000^2 \mod 7 = 1 $$ $$ 1000^3 \mod 7 = 6 $$

But as $i$ grows larger, these expressions can no longer be calculated easily by hand.

I can simplify the expression as such:

$$ 1000^i \mod 7 = (1000 \mod 7)^i \mod 7 = 6^i \mod 7 $$

But even here, when $i$ grows larger, say, when $i = 50$, the expression $6^{50} \mod 7$ isn't easy to calculate, and necessitates splitting $6^{50}$ into smaller "pieces" and composing them.

But I know that the value of $6^i \mod 7$ is very simple: it alternates between 1 and 6 depending on the parity of $i$, so I feel like there must be a way to simplify this expression to capture this alternating property without having to resort to manually calculating each one by hand.

Am I missing something? Thanks for your help.

3

There are 3 best solutions below

0
On BEST ANSWER

$$1000\equiv-1\pmod7$$

$$\implies(1000)^n\equiv(-1)^n\pmod7$$

If $n=2m+1,(-1)^n=(-1)^{2m+1}=-1\equiv6\pmod7$

0
On

$1000 \equiv -1 \mod 7$, so $$1000^n \equiv (-1)^n \equiv \cases{1 \mod 7 & if $n$ is even\cr -1 \mod 7 & if $n$ is odd\cr}$$

0
On

Just adding this in as a slightly different way to think of the problem (this way, you don't actually have to divide a relatively large number like $1000$ by $7$ to find the remainder):

$1000^i \equiv 10^{3i} \equiv 3^{3i} \equiv 27^i \equiv (-1)^i \pmod 7$