What is the remainder of: 13^1031 mod 599 =?
131031(mod599)≡132⋅515+1(mod599)≡(132)515⋅13(mod599)|132(mod599)=169≡169515⋅13(mod599)≡1692⋅257+1⋅13(mod599)≡(1692)257⋅169⋅13(mod599)|1692(mod599)=408≡408257⋅169⋅13(mod599)≡4082⋅128+1⋅169⋅13(mod599)≡(4082)128⋅408⋅169⋅13(mod599)|4082(mod599)=541≡541128⋅408⋅169⋅13(mod599)≡(5412)64⋅408⋅169⋅13(mod599)|5412(mod599)=369≡36964⋅408⋅169⋅13(mod599)≡(3692)32⋅408⋅169⋅13(mod599)|3692(mod599)=188≡18832⋅408⋅169⋅13(mod599)≡(1882)16⋅408⋅169⋅13(mod599)|1882(mod599)=3≡316⋅408⋅169⋅13(mod599)|316=43046721(mod599)=185≡185⋅408⋅169⋅13(mod599)≡165829560(mod599)≡4(mod599)≡4
What is the remainder of: 13^1031 mod 599 =?
131031(mod599)≡132⋅515+1(mod599)≡(132)515⋅13(mod599)|132(mod599)=169≡169515⋅13(mod599)≡1692⋅257+1⋅13(mod599)≡(1692)257⋅169⋅13(mod599)|1692(mod599)=408≡408257⋅169⋅13(mod599)≡4082⋅128+1⋅169⋅13(mod599)≡(4082)128⋅408⋅169⋅13(mod599)|4082(mod599)=541≡541128⋅408⋅169⋅13(mod599)≡(5412)64⋅408⋅169⋅13(mod599)|5412(mod599)=369≡36964⋅408⋅169⋅13(mod599)≡(3692)32⋅408⋅169⋅13(mod599)|3692(mod599)=188≡18832⋅408⋅169⋅13(mod599)≡(1882)16⋅408⋅169⋅13(mod599)|1882(mod599)=3≡316⋅408⋅169⋅13(mod599)|316=43046721(mod599)=185≡185⋅408⋅169⋅13(mod599)≡165829560(mod599)≡4(mod599)≡4
Mmm
I do not know the best way to do this but I will give it a go
13^1031 mod 599
13^1=13 = 13 mod 599
13^2=169 = 169 mod 599
13^3 = 2197 = 400 mod 599
13^4=28561 = 408 mod 588
13^5 = 512 mod 599
13^6 = 67 mod 599
13^7 = 272 mod 599
13^1031= 13^(6*171)*13^5
13^1031= ((67mod599)^171)*512mod599
13^1031= ((67mod599)^5)^34*(67mod599)*512mod599
13^1031= (72mod599)^34*(67*512mod599)
13^1031= (72mod599)^34*(161mod599)
13^1031= ((72mod599)^4)^8*(72mod599)^2*(161mod599)
13^1031= (320mod599)^8*(392mod599)*(161mod599)
13^1031= (320mod599)^3*(392mod599)^3*(320mod599)^2*(392mod599)*(161mod599)
13^1031= (304mod599)*(304mod599)*(570mod599)*(392*161mod599)
13^1031= ((304*304)mod599) * (570mod599)*(217mod599)
13^1031= (170)mod599 * (570*217)mod599
13^1031= (170)mod599 * (296)mod599
13^1031= (170*296)mod599
13^1031 = 4 mod 599
the answer is 4
Verification:
The EASY way of doing it!!!!!:
[13^1031] / 599 =0.0066777963 2721202003 3388981636 0601001669 4490818030.....[Fractional part x 599] =4 !!.
What is the remainder of: 13^1031 mod 599 =? Thanks for help.
Fermat's little theorem states that if p is a prime number, then for any integer a,
ap≡a(modp)
If a is not divisible by p, Fermat's little theorem is equivalent
ap−1≡1(modp)
see: https://en.wikipedia.org/wiki/Fermat%27s_little_theorem
Let p = 599 (prime number)
Let a = 13 (prime number)
gcd(13,599) = 1 ! so 13 and 599 are relatively prime, we can use Fermat's little theorem.
ap−1≡1(modp)13599−1≡1(mod599)13598≡1(mod599)
131031(mod599)≡13598+433(mod599)≡13598⋅13433(mod599)|13598(mod599)=1≡1⋅13433(mod599)≡13433(mod599)≡138⋅54+1(mod599)≡(138)54⋅13(mod599)|138(mod599)=541≡54154⋅13(mod599)≡5413⋅18⋅13(mod599)≡(5413)18⋅13(mod599)|5413(mod599)=162≡16218⋅13(mod599)≡1623⋅6⋅13(mod599)≡(1623)6⋅13(mod599)|1623(mod599)=425≡4256⋅13(mod599)≡4253⋅2⋅13(mod599)≡(4253)2⋅13(mod599)|4253(mod599)=181≡1812⋅13(mod599)≡425893(mod599)≡4(mod599)