Find an integer
x
such that
0≤x<527 and x37≡3(mod527).
0 \leq x < 527\ \text{and} \ x^{37} \equiv 3 \pmod{527}.
x37≡3(mod527)orx37=3+n⋅527|527=17⋅31x37=3+n⋅17⋅31(mod17):x37≡3(mod17)(1)(mod31):x37≡3(mod31)(2)
By Fermat's Little Theorem ap−1≡1(modp) :
a=xp=17:x17−1≡1(mod17)x16≡1(mod17)a=xp=31:x31−1≡1(mod31)x30≡1(mod31)
reduce x37 to x5 and x7 :
x37(mod17)≡x16⏟=1⋅x16⏟=1⋅x5(mod17)|x16≡1(mod17)x37(mod17)≡x5(mod17)≡3(mod17)| see (1) x5≡3(mod17)(3)x37(mod31)≡x30⏟=1⋅x7(mod31)|x30≡1(mod31)x37(mod31)≡x7(mod31)≡3(mod31)| see (2) x7≡3(mod31)(4)
reduce x5 to x :
x16≡1(mod17)|⋅xx16x≡x(mod17)x17≡x(mod17)|if 17(mod16)≡1orx5≡3(mod17)|raise to the power s x5s≡x(mod17)if5s≡1(mod16)solve s:s≡5−1(mod16)s≡5ϕ(16)−1(mod16)|5 and 16 are co-prime!s≡58−1(mod16)|ϕ(16)=8s≡57(mod16)s≡13(mod16)x≡x5s(mod17)≡x5⋅13(mod17)≡(x5)13(mod17)|x5≡3(mod17)≡313(mod17)x≡12(mod17)
reduce x7 to x :
x30≡1(mod31)|⋅xx30x≡x(mod31)x31≡x(mod31)|if 31(mod30)≡1orx7≡3(mod31)|raise to the power s x7s≡x(mod31)if7s≡1(mod30)solve s:s≡7−1(mod30)s≡7ϕ(30)−1(mod30)|7 and 30 are co-prime!s≡78−1(mod30)|ϕ(30)=8s≡77(mod30)s≡13(mod30)x≡x7s(mod31)≡x7⋅13(mod31)≡(x7)13(mod31)|x7≡3(mod31)≡313(mod31)x≡24(mod17)
finally solve the system for x:
(1)x≡12(mod17)(2)x≡24(mod31)17 and 31 are co-prime!x=12⋅31⋅31−1(mod17)31−1(mod17)17−1(mod31)+24⋅17⋅17−1(mod31)≡31ϕ(17)−1(mod17)≡17ϕ(31)−1(mod31)+17⋅31nn∈Z≡3116−1(mod17)≡1730−1(mod31)≡3115(mod17)≡1729(mod31)≡1415(mod17)≡(172)14⋅17(mod31)≡(142)7⋅14(mod17)≡1014⋅17(mod31)≡97⋅14(mod17)≡(102)7⋅17(mod31)≡11(mod17)≡77⋅17(mod31)≡11(mod31)x=12⋅31⋅11+24⋅17⋅11+17⋅31nx=4092+4488+527nx=8580⏟=148(mod527)+527nx=148+527n0≤x<527n=0!x=148
x^37 mod 527 = 3, solve for x
Using simple iteration:
x =148. So that:
x =527n + 148, where n =0, 1, 2, 3.....etc.
Find an integer
x
such that
0≤x<527 and x37≡3(mod527).
0 \leq x < 527\ \text{and} \ x^{37} \equiv 3 \pmod{527}.
x37≡3(mod527)orx37=3+n⋅527|527=17⋅31x37=3+n⋅17⋅31(mod17):x37≡3(mod17)(1)(mod31):x37≡3(mod31)(2)
By Fermat's Little Theorem ap−1≡1(modp) :
a=xp=17:x17−1≡1(mod17)x16≡1(mod17)a=xp=31:x31−1≡1(mod31)x30≡1(mod31)
reduce x37 to x5 and x7 :
x37(mod17)≡x16⏟=1⋅x16⏟=1⋅x5(mod17)|x16≡1(mod17)x37(mod17)≡x5(mod17)≡3(mod17)| see (1) x5≡3(mod17)(3)x37(mod31)≡x30⏟=1⋅x7(mod31)|x30≡1(mod31)x37(mod31)≡x7(mod31)≡3(mod31)| see (2) x7≡3(mod31)(4)
reduce x5 to x :
x16≡1(mod17)|⋅xx16x≡x(mod17)x17≡x(mod17)|if 17(mod16)≡1orx5≡3(mod17)|raise to the power s x5s≡x(mod17)if5s≡1(mod16)solve s:s≡5−1(mod16)s≡5ϕ(16)−1(mod16)|5 and 16 are co-prime!s≡58−1(mod16)|ϕ(16)=8s≡57(mod16)s≡13(mod16)x≡x5s(mod17)≡x5⋅13(mod17)≡(x5)13(mod17)|x5≡3(mod17)≡313(mod17)x≡12(mod17)
reduce x7 to x :
x30≡1(mod31)|⋅xx30x≡x(mod31)x31≡x(mod31)|if 31(mod30)≡1orx7≡3(mod31)|raise to the power s x7s≡x(mod31)if7s≡1(mod30)solve s:s≡7−1(mod30)s≡7ϕ(30)−1(mod30)|7 and 30 are co-prime!s≡78−1(mod30)|ϕ(30)=8s≡77(mod30)s≡13(mod30)x≡x7s(mod31)≡x7⋅13(mod31)≡(x7)13(mod31)|x7≡3(mod31)≡313(mod31)x≡24(mod17)
finally solve the system for x:
(1)x≡12(mod17)(2)x≡24(mod31)17 and 31 are co-prime!x=12⋅31⋅31−1(mod17)31−1(mod17)17−1(mod31)+24⋅17⋅17−1(mod31)≡31ϕ(17)−1(mod17)≡17ϕ(31)−1(mod31)+17⋅31nn∈Z≡3116−1(mod17)≡1730−1(mod31)≡3115(mod17)≡1729(mod31)≡1415(mod17)≡(172)14⋅17(mod31)≡(142)7⋅14(mod17)≡1014⋅17(mod31)≡97⋅14(mod17)≡(102)7⋅17(mod31)≡11(mod17)≡77⋅17(mod31)≡11(mod31)x=12⋅31⋅11+24⋅17⋅11+17⋅31nx=4092+4488+527nx=8580⏟=148(mod527)+527nx=148+527n0≤x<527n=0!x=148