Prove that if n is a perfect square, then n+2 is not a perfect square I'm working on proving the following statement:
If n is a perfect square, then n+2 is not a perfect square.
I also need to state this in first order logic with arithmetic, but have no idea what that looks like.
The only start I have so far in terms of the proof is:
$n$ = $a^2$
$n+2$ = $b^2$
But I don't know how to proceed from here? I've seen solutions to this already but do not understand how they actually prove anything.
 A: Let's assume w.o.l.g that $a, b >= 0$
$b^2 = n+2$
$a^2 = n$
So $b^2 - a^2 = 2$, which means $(b-a)(b+a) = 2$. So $(b+a)$ is a divisor of 2 (either 1 or 2, since $b+a>0$).
Now only a few cases remain


*

*$a = 0, b=1$

*$a = 1, b=0$

*$a = 0, b=2$

*$a = 1, b=1$

*$a = 2, b=0$


No case has $b^2 - a^2 = 2$
A: First, for $n = 1$:
$n = 1$: $n^2 = 1$, $n^2 + 2 = 3$, 3 is not a perfect square
For $n \ge 2$:
There are no perfect squares between $n^2$ and $(n + 1)^2$, exclusive.  For $n \ge 2$, $n^2 < n^2 + 2 < (n + 1)^2$, so $n + 2$ is not a perfect square.
A: For the "logic" part of your question, assume that variables range over nonnegative integers, or the integers. Then we can write
$$\forall x\left(\exists t (x=t\times t)\longrightarrow \lnot\exists s(x+2=s\times s)                             \right).$$
If you are working in first-order Peano arithmetic, replace $x+2$ by $S(S(x))$. 
A: $\forall n\in\mathbb{N}, n^2\equiv0 \text{ or }1 (\mod 4)$.
However, $n^2+2\equiv2 \text{ or }3 (\mod 4)$.
A: $a^2-b^2\not\equiv2\pmod4$  
As $a-b=a+b-2b$
so, $a+b,a-b$ are of same parity
If  one is even, so will be other $\implies a^2-b^2=(a+b)(a-b)\equiv0\pmod4$
If  one is odd, so will be other $\implies a^2-b^2=(a+b)(a-b)$ will be odd $\not\equiv2\pmod4$
A: Bob - The first thing to do is to make sure you believe the result is true. What can you say about the gaps between consecutive squares: 1, 4, 9, 16, ... ? Are any of these gaps 2? If not, how can you demonstrate that this is always the case? (Hint: consider $a^2$ and $(a+1)^2$.) Once you're sure the result can be proved, then you can worry about how to write it.
A: If $n=a^2$ then the next square is $(a+1)^2$
The claim is true for $a=0$ (i.e. $0+2$ is not a perfect square), then for $a \ge 1$:
$(a+1)^2-a^2=2a+1 \gt 2$ 
and so $n+2$ will be less than the next square. 
A: Let's take it from where you left off, but phrase it this way:
Let $n = a^{2}$, where $a$ is an integer.
Now, let's assume for the sake of contradiction that $n + 2 = b^{2}$, for some integer $b$.
Then, taking the difference $b^{2} - a^{2}$, we get
$$ (b + a)(b - a) = b^{2} - a^{2} = (n + 2) - n = 2,$$
which is impossible (for if either $b - a$ or $b + a$ is equal to $1$, the other cannot equal $2$.) 
A: Let us assume $n+2$ is a perfect square:
then, since $n$ is a perfect square, $n=a^2$ (where $a$ is a positive integer).
Since according to our assumption, $n+2$ is a perfect square, $n+2=b^2$ (where $b$ is a positive integer)
Then, we have ,
$$
a^2 +2=b^2
$$
Since the sum of a perfect square (here, $a^2$) and an imperfect square (here, $2$) is always an imperfect square, we know that the left hand side of the equation is an imperfect square and the right hand side of the equation is a perfect square (according to our assumption). So, a clear contradiction arises. This contradiction is due to our false assumption. Thus, $a^2+2$ i.e. $n+2$ is an imperfect square. Hence proved             
