# Find the number of even number such that $0<n\le 100$and $5| (n^2 2^{2n^2} +1)$

Thus $$5|(n^2 4^{n^2} +1)$$

I tried to make it as

$$n^2 4^{n^2} \equiv -1 \pmod 5$$

$$n^2 4^{n^2} \equiv 4 \pmod 5$$

... suggest for how to do that

• You better learn how to type mathematics in this: it's very hard to understand what you wrote. Mar 18, 2020 at 16:10
• Is that supposed to be $n^2\cdot 2^2\cdot n^2$, which is then $4n^4$ in the title? Your first line is different. Mar 18, 2020 at 16:12
• It is n^2 * 2^(2n^2) +1 Mar 18, 2020 at 16:14
• If you look at the patterns of final digit of $n^2$ and of $4^{n^2}$ then it becomes rather easy Mar 18, 2020 at 16:44
• When $4\equiv -1$ and if $n$ is even $4^{n^2}\equiv 1$ so you have $n^24^{n^2} + 1\equiv n^2 + 1$. If $n=2k$ then you have $n^2 + 1=4k^2 + 1\equiv 1-k^2\equiv pmod 5$. If $k\equiv 0,1,2,3,4$ then $1-k^2\equiv 1,0,-3,-3,0$. So $2$ ($2*(5k+1)=10k+2$ and $2*(5k+4)=10k + 8$) out of $5$ of the even numbers will qualify. So $20$. Mar 18, 2020 at 17:58

We have that $$n^24^{n^2}+1\equiv_5n^2(-1)^{n^2}+1$$, also $$n$$ is even so that $$n^2+1\equiv_50\iff {n^2\equiv_5 -1}$$ This gives that $$n\equiv_5 \pm2$$. Since also $$n\equiv_20$$, we conclude that $$n\equiv_{10}\pm2$$

That is $$n\in S=\{2,8,12,18,22,28,32,38,42,48,52,58,62,68,72,78,82,88,92,98\}\\|S|=20$$

I've computed some values of $$n^22^{2n^2}+1\text{ (mod }5)$$ in the table below, using WolframAlpha. $$\begin{array}{|l|l|} \hline n& n^22^{2n^2}+1\text{ (mod } 5) \\ \hline 1& 0\\ \hline \color{green}{2}& \color{green}{0}\\ \hline 3& 2\\ \hline 4& 2\\ \hline 5& 1\\ \hline 6& 2\\ \hline 7& 2\\ \hline \color{green}{8}& \color{green}{0}\\ \hline 9& 0\\ \hline 10& 1\\ \hline 11& 0\\ \hline \color{green}{12}& \color{green}{0}\\ \hline 13& 2\\ \hline 14& 2\\ \hline 15& 1\\ \hline \end{array}$$

If $$n$$ is an even number, then $$n^2$$ is divisible by $$4$$. Now, let $$m=n^2$$, so that $$m \cdot 2^{2m}$$ must then also be divisble by $$4$$. If $$m \cdot 2^{2m}+1$$ is divisible by $$5$$, then $$m \cdot 2^{2m}$$ must end with a $$4$$ (it could not end with a $$9$$ because it is divisible by $$4$$).

Unless $$m=0$$, $$2^{2m}=4^m$$ must always end with a $$6$$ since $$m$$ is even. Hence, it suffices to check the last digit of $$m$$.

Squares never end with the digits $$2$$ or $$8$$ (actually, $$3$$ and $$7$$ are also impossible last digits of squares, but they are odd).

If $$m$$ ends with a $$0$$ (so that $$n$$ also ends with a $$0$$), then $$m \cdot 2^{2m}$$ must once again end with a $$0$$.

If $$m$$ ends with a $$4$$ (so that $$n$$ ends with either a $$2$$ or an $$8$$), then $$m \cdot 2^{2m}$$ must also end with a $$4$$.

Finally, if $$m$$ ends with a $$6$$ (so that $$n$$ ends with either a $$4$$ or a $$6$$), then $$m \cdot 2^{2m}$$ must also end with a $$6$$.

The answer is therefore the number of even numbers under a hundred ending with either a $$2$$ or an $$8$$, which is $$\mathbf{20}$$.

• $n$ doesn't have to be square. So $n$ could end with $8$. Mar 18, 2020 at 17:58
• @fleablood Yes, but $m$ is a square, so it cannot end with a $2$ or an $8$. Mar 18, 2020 at 18:03

Muck it out.

$$n^2 2^{2n^2}+1 = n^24^{n^2}+1 \equiv n^2(-1)^{n^2} + 1 \equiv \begin{cases}-n^2 +1 &\text{if }n\text{ is odd}\\n^2 +1&\text{if }n\text{ is even}\end{cases}\pmod 5$$.

If $$n$$ is even then let $$n=2k$$ and $$n^2=4k^2 \equiv -k^2$$and let $$k\equiv 0,\pm 1, \pm 2$$ then $$n^2 + 1\equiv -k^2 + 1\equiv 1,0,2\pmod 5$$.

So $$k\equiv \pm 1 \pmod 5$$ so $$k= 5m \pm 1$$ and $$n = 10m \pm 2$$ so there are $$20$$ such even numbers $$2,8,12,18,...etc...$$.

If $$n$$ is odd then let $$n = 2k+1$$ and $$n^2 = 4k^2 + 4k +1\equiv -k^2 -k+1$$ and $$-n^2+1\equiv k^2 + k\pmod 5$$. If $$k\equiv 0, 1,2,-2,-1$$ then $$k^2 + k\equiv 0,2,1,2,0$$ so $$k \equiv 0,-1\pmod 5$$ for $$k = 5m +(0,-1)$$ and $$n = 10m +1 (-2)=10m\pm 1$$. So odd numbers $$n = 1,9,11,19$$ etc.

I know you specified that $$n$$ is even but... we might as well have figure them all out.