# Proof: If n is a perfect square, $\,n+2\,$ is NOT a perfect square

"Prove that if n is a perfect square, $\,n+2\,$ is NOT a perfect square." I'm having trouble picking a method to prove this. Would contraposition be a good option (or even work for that matter)? If not, how about contradiction?

-
The first question is not "What method shall I use?" but "What's happening here?". So fool around with numbers. Anyway, contraposition is probably hard on the back. – André Nicolas Sep 23 '12 at 19:54
@AndréNicolas I disagree re. contraposition. To get from a square to the next smallest square, you have to subtract an odd number ... – Neal Sep 23 '12 at 19:56
@Neal: Ultimately we will use, at least implicitly, some logical apparatus. A little experimentation will show that the next square is always too much bigger, or some parity condition is violated. Once it is clear that this seems to be the case, one can worry about proving it. But the insight about what might be going wrong comes first. Does the Math Department have a new building? It has been forever since I was at IU. – André Nicolas Sep 23 '12 at 20:01
@AndréNicolas I'm sorry, I should have been clearer. I wholeheartedly agree that insight should come first. I just meant that some insights would suggest logical contraposition. Anyway, the Math Dept. is still in Rawles, the grad students are still infesting Swain East, but the Atwater house got a makeover last year. Who did you work with at IU? – Neal Sep 23 '12 at 20:21
I was an Assistant Professor there. And we were in Swain. Some fond memories. – André Nicolas Sep 23 '12 at 20:43

Hint: Every perfect square is either $0$ or $1$ modulo $4$.

-
+1 I liked this one! – DonAntonio Sep 23 '12 at 19:50
Haha thats not a hint, thats an answer! – Joachim Sep 23 '12 at 22:25
No, I think it is a hint, in particular taking into account the probable basic level the OP has in these matters...and a rather nice, fine hint. – DonAntonio Sep 24 '12 at 2:48
how to prove this one? – Louis Rhys Sep 24 '12 at 5:24
@LouisRhys: Consider $(2k)^2$ and $(2k + 1)^2$. – Parth Kohli Jan 1 '13 at 15:35

Suppose $n=m^2$ and $n+2=k^2$. Clearly $k>m$, so $k\ge m+1$. But then $$n+2\ge (m+1)^2=m^2+2m+1\ge m^2+3=n+3$$ a contradiction.

-
That proof only works for $n>0$ (but for $n=0$ it's easily checked directly). – celtschk Sep 23 '12 at 19:50
@celtschk Yes, of course. This generalizes to large differences than $2$ as well, if you check finitely many cases. – Alex Becker Sep 23 '12 at 20:09

$$n=a^2\,\,,\,\,n+2=b^2\Longrightarrow 2=(n+2)-n=b^2-a^2=(b-a)(b+a)$$

Now check that this is impossible (and $\,b>0\,$ )

-
Do you mean set (b-a)=2 and set (b+a)=2? – Greg Sep 23 '12 at 19:58
Well, yes: we have that $\,b-a\,,\,b+a>0\,$ and $\,b-a<b+a\,$ , so it must be $\,b+a=2\,,\,b-a=1\,$ , and this system has no integer solutions. – DonAntonio Sep 23 '12 at 20:00
What do you mean by (and $b>0$)? Seems to me that's not important. – Ben Millwood Sep 23 '12 at 20:42
Just to avoid the option $\,(-2)(-1)\,$ , and everything is positive, that's all. – DonAntonio Sep 23 '12 at 21:06

Hint $\rm\ f(n) = n^2\:$ is increasing on $\Bbb N$ so the difference between two different values is at least the difference between two consecutive values, which is $\rm\:(n\!+\!1)^2 - n^2\:\! =\, 2n\!+\!1 > 2\:$ for $\rm\:n > 0.$

Remark $\$ This has a natural presentation by telescopy, e.g.

$$\rm f(4)\!-\!f(1)\ =\ f(4)\!-\!f(3)\ +\ f(3)\!-\!f(2)\ +\ f(2)\!-\!f(1)$$

and since each RHS difference is $> 2,\,$ so too is the LHS.

-

I don't know that you should pick a proof strategy before you have played with the hypotheses a little bit. In my experience, thinking about the hypotheses tends to suggest natural proof strategies.

In this case, I would think like this: perfect squares are the partial sums of the series of positive odd numbers, so you can't get to the next perfect square by adding $2$. This suggests contradiction.

Alternatively -- and this would suggest proof by contraposition -- if you have arranged $n$ tiles in a square, and you remove two, can you rearrange those into a smaller square?

-

More generally, for every positive integer $m$, there are only a finite number of positive integers $n$ such that $n^2+m$ is a perfect square.

Proof: Suppose $n^2+m = (n+k)^2$. Then $m = 2nk + k^2 > 2nk \ge 2n$, so $n < m/2$.

If $m = 2$, then $n < 1$, so there are no solutions.

To find all solutions for a particular large $m$, congruences can greatly reduce the number of cases that have to be tested.

This readily generalizes to any function that increases at least linearly: If $f(n+1)\ge f(n)+cn$ for some positive $c$, then, for any positive $m$, there are only a finite number of $n$ such that $f(n)+m = f(k)$ for some $k > n$.

Proof: $f(n+k) \ge f(n)+cnk$ (you can do better, but this is enough), so if $f(n+k)-f(n)=m$, $m \ge cnk \ge cn$ or $n \le m/c$.

Generalizing further (my goal is a theorem so general it has no particular application), the result holds if $f(n+1)-f(n) \ge g(n)$ where $g$ is strictly increasing and unbounded (an example of a slowly growing $g$ is $\log$).

Proof: $f(n+k)-f(n) \ge g(n)+g(n+1)+ ... +g(n+k-1) > kg(n)$ so, if $f(n+k)-f(n) = m$, $m > kg(n)$. The assumptions about $g$ imply that. for any particular $m$, there are only a finite number of $n$ satisfying this.

-

You don't even need algebra to do this – think squared paper. The only thing to specify about a square is its side length, so if you want to show a bigger square is a perfect square, the only thing you can do is increase the side length. But if you increase the side length by 1, you need to add at least 1 square to each side, and 1 on the corner, so you need to add at least three squares.

This is aside from the case where $n = 0$. But $2$ isn't a perfect square, so that's fine.

-

Here's the key fact: the sum of consecutive odds make all perfect squares. For example, $$1=1^2$$ $$1+3=2^2$$ $$1+3+5=3^3$$ $$1+3+5+7=4^2$$ and so on. To prove this, you can either draw a picture or use this algebraic/inductive method. Let $$n^2=1+3+5+\cdots +(2n-1),$$ then $$(n+1)^2 = n^2+2n+1=1+3+5+7+\cdots (2n-1)+(2n+1).$$ Therefore, if $$n=k^2=1+3+5+\cdots (2k+1)$$ then $$n+2=k^2+2=1+3+5+7+\cdots (2k-1)+(2k+3)...$$ note that it's not $2k+1...$. This clearly won't be a perfect square.

-

If $n$ is odd and perfect square, then it is of the form $n=8k+1$. But $n+2=8k+1+2$ is also an odd number, so it must be of the form $8k'+1$ which is not.

If $n$ is even, It is of the form $n=4k^2$ while $n+2=4k^2+2$ is even but not of the form $4k'^2$. Therefore $n+2$ is not a perfect square. In each case such $n$ does not exist.

-