note
321 leaves 4
322 leaves 2
323 leaves 1
324 leaves 4
325 leaves 2
.
.
.
323n+1 will leave remainder 4
now considering division by 3
321 leaves 2
322 leaves 1
323 leaves 2
.
.
3232 will leave 1 i.e. will be of the form 3n+1
so answer = 4
note
321 leaves 4
322 leaves 2
323 leaves 1
324 leaves 4
325 leaves 2
.
.
.
323n+1 will leave remainder 4
now considering division by 3
321 leaves 2
322 leaves 1
323 leaves 2
.
.
3232 will leave 1 i.e. will be of the form 3n+1
so answer = 4
Alternately we can also apply congruencies.....
32^{\phi(7)}\equiv 1(mod7) From which we have 32^{6}\equiv 1(mod7)
For the remaining part we have 32\equiv 2(mod6)
2^8=256\equiv 4(mod6)\implies 2^{32}\equiv 32^{32}\equiv 4(mod6)
Thus we just effectively need to figure out the rem when 32^4 is divided by 7, which is the rem when 256 is divided by 7, which is 4.