SEARCH HOME
 Math Central Quandaries & Queries
 Question from Nazrul: Find the remainder when (2018^2019)-(2019^2018) is divided by 4? Please show me the process.

Hi,

I am going to make liberal us of the Binomial Theorem which says

If $a$ and $b$ are real numbers and $n$ is a positive integer then

$(a + b)^n = \left(\begin{array}{c}n\\0 \end{array}\right) a^n + \left(\begin{array}{c}n\\1 \end{array}\right) a^{n-1}b^1 + \left(\begin{array}{c}n\\2 \end{array}\right) a^{n-2}b^{2} + \cdot \cdot \cdot + \left(\begin{array}{c}n\\{n-1} \end{array}\right) a^1 b^{n-1} + \left(\begin{array}{c}n\\n \end{array}\right) b^{n}.$

What is important in what I am going to do is that

$\left(\begin{array}{c}n\\k\end{array}\right) \mbox{ is a positive integer for } k = 0, \cdot \cdot \cdot ,n$

and that

$\left( \begin{array}{c}n\\n\end{array}\right) = 1$

For $2018^{2019}$ I want to write $2018$ as $2016 + 2$ and think about expanding

$2018^{2019} = (2016 + 2)^{2019}$

using the Binomial Theorem with $a = 2016$ and $b = 2.$ Since $2016$ is divisible by $4,$ each of the terms on the right side of the Binomial Theorem is divisible by $4$ except perhaps the last term. Hence if $2018^{2019}$ is divided by $4$ the remainder is

$\left(\begin{array}{c}n\\n \end{array}\right) b^{n} = 1 \times 2^{2019}.$

But

$2^{2019} = (2 \times 2)^{1009} \times 2 = 4^{1009} \times 2$

and division of this term by $4$ leaves a remainder of $2.$ Hence when $2018^{2019}$ is divided by $4$ the remainder is $2.$

In a similar fashion for $2019^{2018}$ write $2019$ as $2016 + 3$ and again use the Binomial Theorem. As before dividing by $4$ leaves a remainder of $3^{2018}.$ This time write $3 = 4 - 1$ and apply the Binomial Theorem to $(4 - 1)^{2018}.$ All but the last term is divisible by $4$ and the last term is $(-1)^{2018} = 1.$ hence when $2019^{2018}$ is divided by $4$ the reminder is $1.$

Finally we see that when $2018^{2019} - 2019^{2018}$ is divided by $4$ the remainder is $2 - 1 = 1.$

Harley

Math Central is supported by the University of Regina and The Pacific Institute for the Mathematical Sciences.