We can represent 798 as,
798=(72)49
798=(49)49
798=(50−1)49
Therefore, using binomial expansion, we have
798=49C0(50)49−49C1(50)48+.......+49C48(50)−49C49
Here, except the last each term contains multiple of 5. Therefore,
798=5(k)−1, where k be any integer
Now,
798=5k−1+5−5
798=5(k−1)+4
Now, divide both the sides by 5.
7985=5(k−1)5+45
7985=(k−1)+45
Hence, the remainder will be 4.