# Proof that square of an $\sqrt{2 - 4q}$ is not an integer

I want to find a solution for $x$ such that

$(2-x^2) = 0 \mod{4}$

If that is true, I can write

$(2 - x^2) = 4q$

for some integer $q$. We solve for $x$ and get the expression

$x = \sqrt{2 - 4q}$.

I can choose $q$ myself, but no matter what $q$ I choose, I always get $x$ equal to a decimal number. As long as $x$ is a decimal number, $(2-x^2) \mod{4}$ can not be equal to $0$ and so it seems like the equation has no solution. But in order to say this for sure I need to prove that $x$ can not be an integer for any value of $q$. How do I do that?

• "As long as $x$ is a decimal number $(2 - x^2) \pmod{4}$ cannot be equal to $0$": This is false, as can be seen by taking $x = \sqrt{2}$ (unless your "decimal numbers" are real numbers with terminating decimal expansions, rather than all real numbers). Sep 8, 2016 at 11:39
• "decimal number" is absolutely the wrong term to use here. (I don't know what the right term is, because I don't know what you mean by it.) Sep 8, 2016 at 13:34
• Your title is misleading, you mean x is not an integer, not its square. Sep 8, 2016 at 19:02
• @TonyK She means "a number that possesses decimals", in other words a number that is not whole; I guess you would call it a member of $\mathbb{R} \setminus \mathbb{Z}$. Sep 9, 2016 at 12:28
• @JeppeStigNielsen: You might be right about $\mathbb{R} \setminus \mathbb{Z}$. But "a number that possesses decimals" is literally meaningless. Sep 9, 2016 at 13:18

Hint : If $n$ is some integer, then

$n=0 \mod{4} \implies n^2=0 \mod{4}$

$n=1 \mod{4} \implies n^2=1 \mod{4}$

$n=2 \mod{4} \implies n^2=0 \mod{4}$

$n=3 \mod{4} \implies n^2=1 \mod{4}$

Apart from @Vincent's answer, here's another way of looking at it $$x=\sqrt{2-4q}$$ Clearly, $2-4q$ is divisible by $2$ but not by $4$ for any integer $q$. Thus, it cannot be a perfect square.

Let $x \in \Bbb Z$ be a solution. Of course $x$ must be even, since an odd $x$ would make $2-x^2$ odd too.

Now let $x=2y$, then $2-x^2=2-4y^2=2(1-2y^2)$. But $1-2y^2$ is odd, so $4$ can't divide $2-x^2$.

This shows there doesn't exist solutions for that equation in $\Bbb Z$

This answer builds completely on GoodDeed's excellent answer, but I think going into further detail is useful.

Consider that

$$x=\sqrt{2-4q} = \sqrt{2 (1 - 2q)} = \sqrt 2 \sqrt{1 - 2q}$$

$1 - 2 q$ is odd for all $q \in \Bbb Z$. This means that $x$ must be irrational because $\sqrt{1 - 2q}$ will never have a factor of $\sqrt 2$.

It may be worth noting that while $x$ cannot be an integer value, your question doesn't make clear why you need to exclude these solutions. An irrational $x$ is a valid solution, unless there are other constraints on it you're not mentioning.