1

So I was reading through some old questions I found

For the question I was asked to explain why for $\,2018^{\large 2017^{\LARGE n}}\!\!\bmod 1001$

Where n is an integer between 14 million and 17 million

Why are there are only 4 possible values?

So I figured it out through taking 2017$^n$ (mod 720) As 720 = phi(1001)

Using modular exponentiation I noted a few facts

2017$^1$ (mod720) ≡ 577

2017$^2$ (mod720) ≡ 289

2017$^4$ (mod720) ≡ 1

So therefore anything after this point will be congruent to 1 (mod 720)

So for example if I obtain 2017$^{15}$ = 2017$^8$ * 2017$^4$ * 2017$^2$ * 2017$^1$ Well this is just the same as 1 * 1 * 289 * 577 = 433(mod26)

And then I just finished the question by doing 2018$^{433}$ (mod 1001) ≡ 653

Now I just showed this with the 3 other patterns but basically I was wondering if there was a more elegant way to put this?

I feel like i'm there but it's not really a clean answer

Any help is appreciated.

2 Answers2

1

Because of $\ \ \gcd(2018,1001)=1$, we can apply Euler's theorem and reduce the exponent modulo $\varphi(1001)=720$. The exponent is itself a power and because of $$2017^4\equiv 1\mod 720$$ which you found out, we can reduce $n$ modulo $4$. Hence there are only $4$ possible residues.

Bernard
  • 175,478
Peter
  • 84,454
  • Does this answer not rely on the fact I already know there are only 4 possible answers though? – MakkaPakka Jan 31 '19 at 19:44
  • No, this is an easy consequence of the congruence you found out. – Peter Jan 31 '19 at 19:46
  • Sorry for being really dumb with this, Number theory isn't my strong point but why does 2017^ 4 ≡ 1 (mod720) imply there are only 4 solutions – MakkaPakka Jan 31 '19 at 19:48
  • OK, you want to know how to find out this congruence by hand, right ? I assumed that we can use this congruence, but I can try to work out a solution. – Peter Jan 31 '19 at 19:50
  • Well i'm just curious how we know the congruence you showed implies only 4 possible residues if that makes sense? Sorry if i'm not being clear – MakkaPakka Jan 31 '19 at 19:51
  • OK, lets start with the implication. You can write every positive integer $n=4k+m$ with $0\le m\le 3$. So, we have $$2017^n= 2017^{4k+m}=(2017^4)^k\cdot 2^m\equiv 2^m\mod 720$$ hence $2017^n$ must be congruent to one of the four powers $2017,2017^2,2017^3,2017^4$ modulo $720$ – Peter Jan 31 '19 at 19:53
  • For the congruence itself , note $2017\equiv 1\mod 144$ , hence $2017^4\equiv 1\mod 144$. Since $2017^4\equiv 1\mod 5$ follows from Fermat's little theorem, using the chinese remainder theorem gives $2017^4\equiv 1\mod 720$ – Peter Jan 31 '19 at 19:56
  • I probably should have written "one of the four powers $2017^0,2017^1,2017^2,2017^3$ modulo $720$" , nevertheless $2017^0$ and $2017^4$ have the same value modulo $720$ , namely $1$. – Peter Jan 31 '19 at 19:59
  • 1
    Ok thanks I think i'm following aha – MakkaPakka Jan 31 '19 at 20:07
0

Below is the Theorem that you are implicitly applying.

Theorem $\ \ \color{#c00}{a^{\large n} \equiv 1}\pmod{\! m},\ \color{#0a0}{b^{\large k}\equiv 1}\pmod {\!n}\,\Rightarrow\, a^{\Large b^{\Large N}}\!\!\!\in \{a,\, a^{\large b},\, a^{\large b^{\Large 2}},\ldots\, a^{\large b^{\Large k-1}}\}\pmod{\!m}$

Proof $\ $ Dividing $\,N\,$ by $\,k\,$ yields $\ N = kq+R\ $ with $\,0\le R\le k-1.\,$

$\!\bmod n\!:\ \ \ b^{ N} =\, b^{\large R+kq} \,=\ b^{ R} (\color{#0a0}{b^{\large k}})^{\large q}\,\equiv\, b^{R}\, \color{#0a0}1^{\large q}\equiv b^{R},\: $ so $\ b^N = b^R\!+ni\ $ thus

$\!\bmod m\!:\ a^{\large b^{\Large N}}\!\!\! = a^{\Large b^{\Large R}\! + ni}\! \equiv a^{\Large b^R}\! (\color{#c00}{a^{\Large n}})^{\Large i}\!\equiv a^{\Large b^R}\! \color{#c00}1^{\Large i}\equiv a^{\Large b^R}$

Corollary $\ a^{\Large b^{\LARGE N}}\!\!\equiv\,\color{#c00}a^{\Large \color{#0a0}b^{\LARGE N\bmod\color{#0a0} k} \!\bmod\color{#c00} n}\!\! \pmod{\!m}$

Bill Dubuque
  • 272,048