The cyclicity of 8p is 4 i.e., the remainder repeats in cycle of 4 when divided by 13. 2017=(504×4)+1     Remainder 81=8‌‌‌‌‌‌‌‌‌‌‌‌8 82=64‌‌‌‌‌‌‌‌‌12 83=512‌‌‌‌‌‌‌‌‌5 84=4096‌‌‌‌‌‌‌1 85=32768‌‌‌‌‌8 86=262144‌‌‌12 ∴82017=8(504*4)+1 Remainder of 82017 is same as remainder of 81 = 8 Hence n=8. Aliter : (8)2017&=8×82016=8(64)1008 R[8×(64)1008]=8×(−1)1008=8