TITLE: How to find the remainder of $\frac{2^{99}}{9}$?
QUESTION [5 upvotes]: The question is solved in the book I read in a very odd way as,

$$\frac{2^{99}}{9} = \dfrac{{(2^{3})}^{33}}{2^3-(-1)}$$
  Hence by remainder theorem the remainder is $-1$. In questions when remainder is negative than the number is subtracted from numbers like $2^3$ to get a positive number so the answer is $8-{-1}=9$.

I don't know which remainder theorem the book is talking of. I converted the question in mod notation as,
$$2^{99} \bmod 9 = (2^3)^{33} \bmod (2^3 - (-1))$$
But I don't think there is some formula for $a \bmod (c-d)$. Please tell me how to solve these type of questions.

REPLY [3 votes]: The theorem referred to is probably the polynomial remainder theorem. That is that the remainder of $p(x)/(x-a)$ is $p(a)$. So with $p(x) = x^{33}$ and $a=-1$ we have that the remainder of the division will be $p(-1) = (-1)^{33}$. That is:
$$p(x) = x^{33} = (x-(-1))q(x) + (-1)^{33} = (x-(-1))q(x) - 1$$
Inserting $x = 2^3$ into this results in 
$$p(2^3) = (2^3-(-1))q(2^3) - 1 = 9q(2^3)-1$$
From this we can see that $2^{99} = 9q(2^3) - 1 = 9q(2^3)-9+8 = 9(q(2^3)-1) + 8$ and since $q$ is a polynomial with integer terms we have that $Q = q(2^3)-1$ is an integer so $2^{99} = 9Q + 8$

For proof of the polynomial remainder theorem let $p(x)$ be a polynomial and use euclid division with $x-a$ then we will get a result $q(x)$ and a remainder $r(x)$ of degree one less than $x-a$, that is r(x) is a constant expression $C$. Now the result of the division will be 
 $$p(x) = q(x)(x-a) + r(x) = q(x)(x-a) + C$$. 
Now substitute $x$ with $a$ and we get 
$$p(a) = q(a)(a-a) + C = 0q(a) + C = C$$