SOLUTION: Find the remainder when 4^503 is divided by 255

Algebra ->  Probability-and-statistics -> SOLUTION: Find the remainder when 4^503 is divided by 255      Log On


   



Question 1137583: Find the remainder when 4^503 is divided by 255
Found 4 solutions by math_helper, Edwin McCravy, ikleyn, AnlytcPhil:
Answer by math_helper(2461) About Me  (Show Source):
You can put this solution on YOUR website!
Applying Euler's Theorem:
++4%5Ephi%28255%29+=+1+ (mod 255)


+phi%28255%29+=+128
so
+4%5E%28128%29+=+1+ (mod 255)
sorry ... pressed Post Answer too soon


I had hoped to use Euler's Theorem to reduce the exponent to something small. However for this problem one ends up with +4%5E119+ (mod 255)
(119 = 503-128*3), and now the computation of +4%5E119+ is still too large.



Just to finish the thought... the method to reduce +4%5E119+ (mod 255)
is to factor 255 into 3*5*17 and then apply Euler's Theorem to each of these.
Once that is done, you will have a set of three modulo congruences which may be solved using the Chinese Remainder Theorem.
Phi(3) = 2 [ Phi(prime) = prime - 1, always ]
+4%5E119+ (mod 3) = +%284%5E2%29%5E59+%2A+4+ (mod 3) = +1%5E59+%2A+4+ (mod 3) = 4 (mod 3) = 1 (mod 3)
+4%5E119+ (mod 5) = +%284%5E4%29%5E29+%2A+4%5E3+ (mod 5) = 64 (mod 5) = 4 (mod 5)
+4%5E119+ (mod 17) = +%284%5E16%29%5E7+%2A+4%5E7+ (mod 17) = 13 (mod 17)
This leads to the set of congruences
13+17n = 13 (mod 17) = 4 (mod 5) = 1 (mod 3)
This can be solved piecewise, algebraically, but since modulus is only 255, you can just list remainder values (mod 255) starting with the largest prime factor to make the list shorter:
13, 30, 47, 64, 81, 98, 115, 132, 149, 166, 183, 200, 217, 234, 251

then list the mod 5 values for these:
3, 0, 2, 4, 1, 3, 0, 2, 4, 1, 3, 0, 2, 4, 1
then list the mod 3 values:
1 0 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2

Then notice 64 is the only value satisfying all 3 conditions. The solution is unique, so in practice, if you were listing out the 13 (mod 17) values in the first row, you could check the (mod 5) and (mod 3) values then stop at 64.
------------

Answer by Edwin McCravy(20054) About Me  (Show Source):
You can put this solution on YOUR website!
The above solution is incorrect.



      Observe that the sequence of exponents 998,990,... is an arithmetic
      sequence with common difference -8, and smallest positive term 6.
      a%5Bn%5D=a%5B1%5D%2B%28n-1%29d=%22%22
      998%2B%28n-1%29%28-8%29=%22%22
      998-8n%2B8=%22%22
      1006-8n%3E0
      1006%3E8n
      125.75%3En
      The 125th term is 
      a%5B125%5D=998%2B%28125-1%29%28-8%29=6







%282%5E8-1%29%282%5E998%2B2%5E990%2B%22...%22%2B2%5E14%2B2%5E6%29%2B2%5E6=%22%22

%28256-1%29%282%5E998%2B2%5E990%2B%22...%22%2B2%5E14%2B2%5E6%29%2B64

255%282%5E998%2B2%5E990%2B%22...%22%2B2%5E14%2B2%5E6%29%2B64

So the remainder is 64.

Edwin

Answer by ikleyn(52780) About Me  (Show Source):
You can put this solution on YOUR website!
.

            I have much more simple solution.


First, notice that 255 = 256 - 1 = 4%5E4-1,  so  4%5E4 = 255 + 1.


Second, notice that  4%5E503 = 4%5E500%2A4%5E3 = %284%5E4%29%5E125%2A64.


Therefore,  4%5E503 = %28255%2B1%29%5E125%2A64.


Apply the Newton's binomial formula to present  %28255%2B1%29%5E125 as the sum of degrees of the number 255 with integer coefficients.

All the terms of this binomial expansion will have the number 255 in positive degrees, except the last term, which is 1.


So, all the terms of this binomial expansion are divisible by 255, except the last term 1.


It means that when you multiply this expansion by 64, all the terms of this new expansion are divisible by 255, 
except the last term, which is 64.


It proves that the reminder of  4%5E503 is 64, when it is divided by 255.

Solved.

-------------

By the way, it is a STANDARD method for solving such problems.

It works smoothly in many other similar problems.



Answer by AnlytcPhil(1806) About Me  (Show Source):
You can put this solution on YOUR website!
I think the straight-forward way, i.e., 
"divide it out and see what the remainder is"
is the best way:



          4⁴⁹⁹ + 4⁴⁹⁵ + ... + 4⁷ + 4³
4⁴-1)4⁵°³
     4⁵°³-4⁴⁹⁹
          4⁴⁹⁹ 
          4⁴⁴⁹ - 4⁴⁹⁵     
                 4⁴⁹⁵
                        ...   
                              4⁷
                              4⁷ - 4³
                                   4³ = R
Edwin