Quote:
|
Originally Posted by amar_kashyap
We know by fermat's theorem that N^(p-1) -1 is a multiple of p if N is prime to P. In this case 1001 is prime to 3 so we can write
3^(1000) -1= 1001n where n is any integer.
ie 3^(1000)= 1001n+1
ie 3^(1001)= 3003n+3 which when divided by 1001 yields 3 as remainder.
The answer is 3
|
Prob 5:
1001 = 7*11*13 (not a prime!)
The solution has two steps:
1. Find the remainders when 3^1001 is divided by 7, 11 and 13 respectively. This is done by using Fermat's little theorem.
Now 3^6 = 7k + 1
=>3^1001 = 3^5 * (3^6)^166 = 243*(7k' + 1) = 7a + 5
Similarly: 3^1001 = 11b + 3 = 13c + 9
2. Now we have the remainders when 3^1001 is divided by 7,11, 13. Now use Euclid's algo to find the remainder when 3^1001 is divided by 7*11*13
Basically we have a = 7x+5 = 11y+3 = 13z+9
11a = 77x + 55....(i)
7a = 77y + 21...(ii)
8*(ii) - 5*(i) => a = 77k + 166 - 275 = 77k' + 47 ....(iii)
From (iii) we have: 13a = 1001k' + 13*47.....(iv)
and we also have 77a = 1001z + 77*9.......(v)
6*(iv) - (v) => a = 1001k'' + 78*47 - 77*9 = 1001*Q + 971
Ans: 971
Disclaimers:
I have not double checked the calculations....
There could be a shorter method too...