For what values of n, will $1 + 2^n + 3^n + 4^n$ be divisible by $5$ where $0 \leq n \leq 100$

39 Views Asked by At

There's this problem that I am trying to find the solution for:

For what values of n, will $1 + 2^n + 3^n + 4^n$ be divisible by $5$ where $0 \leq n \leq 100$

So that doesn't hold for $n=0$, but then I am stuck as to what approach to take. It has to do with the last digit being $0$ or $5$, or not! I can't seem to factorize it either, $4^n = 2^{2n}$ then what? I want to know some hints and approaches to take, the final answer doesn't matter to me.

1

There are 1 best solutions below

0
On

$1 + 2^n + 3^n + 4^n \equiv 1 + 2^n + (-2)^n + (-1)^n\pmod 5$.

If $n$ is odd then $1+2^n +(-2)^n + (-1)^n \equiv 0 \pmod 5$ and $5$ will divide $1+2^n + 3^n + 4^n$ if $n$ is odd.

If $n=2k$ is even then $1+ 2^n + (-2)^n + (-1)^n\equiv 2\cdot 1 +2\cdot 2^{n}\equiv 1 + 2\cdot 4^{k}\equiv 2 + 2(-1)^k \equiv \begin{cases} 4&k\ even\\0&k\ odd\end{cases}$. So $5 \mid 1 + 2^n + 3^n + 4^n$ if $n=2k$ and $k$ is odd.

So the solution is $5$ divides $n$ if $n$ is odd or if $n$ is $2$ times an odd number.

.......

Alternatively if you don't know modular arithmetic.

let $n = 4k + i$ where $i= 0,1,2,3$

Then $1^n + 2^n + 3^n + 4^n =$

$1 + 2^{4k+i} + 3^{4k+i} + 4^{4k +i} =$

$1 + 16^k*2^i + 81^k*3^i + 256^k*4^i$.

Now $16 = 15 + 1$ so $16^k = (15 + 1)^k = 5M + 1$ for some $M$.

$81^k = (80+1)^k = 5N +1$ for some $N$

$256^k = 5W + 1$ for some $W$ so

$1 + 2^n + 3^n + 4^n = 1 + (5M+1)2^i + (5N+1)3^i + (5W+1)4^i =$

$5(2^iM + 3^iN + 4^iW) + (1 + 2^i + 3^i + 4^i)$.

That is divisible by $5$ if and only if $1+2^i +3^i +4^i$ is.

$1 + 2^0 + 3^0 + 4^0 = 4$ is not.

$1 + 2^1 + 3^1 +4^1 = 10$ is

$1 + 2^2 + 3^2 + 4^2 = 1+4 + 9 + 16= 30$ is.

$1 + 2^3 + 3^3 +4^3 = 1 + 8 + 27+ 64 = 100$ is.

So if $n$ is not divisible by $4$ then $1 + 2^n +3^n + 4^n$ is divisible by $5$.

(Which is the exact same thing as $n$ is odd ($n = 4k+1$ or $n = 4k + 3$) or $n$ is $2$ times an odd number ($n = 4k + 2$)).