I saw in a magazine that there was a contest or something about determining the 3 last digits of 3^123456, is there anyone that could help with this?
I saw in a magazine that there was a contest or something about determining the 3 last digits of 3^123456, is there anyone that could help with this?
3123456(mod1000)≡?
aφ(m)=1(modm), if gcd(a,m)=1
a=3
m=1000=23⋅53
1.) gcd(3,1000)=1
2.)
φ(1000)=1000⋅(1−12)⋅(1−15)φ(1000)=1000⋅(12)⋅(45)φ(1000)=400
3.) 3400=1(mod1000)
4. Split 123456 in units of 400
123456=400⋅308+2563123456(mod1000)=3400⋅308+256(mod1000)=3400⋅308⋅3256(mod1000)=(3400⏟=1(mod1000))308⋅3256(mod1000)=1308⋅3256(mod1000)=1⋅3256(mod1000)=3256(mod1000)|310=49(mod1000)=310⋅25+6(mod1000)=310⋅25⋅36(mod1000)=(310)25⋅36(mod1000)=(49)25⋅36(mod1000)
=1311081016089963454886184368275274375604160521(mod1000)=521
I saw in a magazine that there was a contest or something about determining the 3 last digits of 3^123456, is there anyone that could help with this?
3123456(mod1000)≡?
aφ(m)=1(modm), if gcd(a,m)=1
a=3
m=1000=23⋅53
1.) gcd(3,1000)=1
2.)
φ(1000)=1000⋅(1−12)⋅(1−15)φ(1000)=1000⋅(12)⋅(45)φ(1000)=400
3.) 3400=1(mod1000)
4. Split 123456 in units of 400
123456=400⋅308+2563123456(mod1000)=3400⋅308+256(mod1000)=3400⋅308⋅3256(mod1000)=(3400⏟=1(mod1000))308⋅3256(mod1000)=1308⋅3256(mod1000)=1⋅3256(mod1000)=3256(mod1000)|310=49(mod1000)=310⋅25+6(mod1000)=310⋅25⋅36(mod1000)=(310)25⋅36(mod1000)=(49)25⋅36(mod1000)
=1311081016089963454886184368275274375604160521(mod1000)=521