7

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.

Bob Shannon
  • 1,561

10 Answers10

6

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$

Guido
  • 642
  • 2
    Perhaps a nicer way to prove this is by noting that $a$ and $b$ must be consecutive (otherwise $a$ and $b$ differ by $2$ or more, which means their squares differ by $4$ or more. And if they are consecutive, the difference of their squares is odd. The proof by @njguliyev in the comment is also neat. – Guido Aug 06 '20 at 21:27
5

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.

rgettman
  • 764
3

$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$

3

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))$.

André Nicolas
  • 507,029
3

$\forall n\in\mathbb{N}, n^2\equiv0 \text{ or }1 (\mod 4)$.

However, $n^2+2\equiv2 \text{ or }3 (\mod 4)$.

meta_warrior
  • 3,288
  • 18
  • 34
1

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$.)

DDS
  • 3,199
  • 1
  • 8
  • 31
1

Well let's start with your method only

n = a^2

n+2 = b^2

Here we assume that n+2 is also a perfect square and we'll try to get a contradiction.

Now,

n+2 - n = b^2 - a^2

b^2 - a^2 = 2

But two perfect squares have minimum a difference of 3 (can be proved easily by minimising one of the two squares to get the minimum difference).

Therefore we get a contradiction and n+2 can't be a perfect square.

1

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.

Chris Leary
  • 2,993
  • The fact that there are no gaps of 2 makes a lot of sense that n+2 is not a perfect square. But how do I prove it? – Bob Shannon Oct 23 '13 at 19:15
  • 1
    The difference between $(a+1)^2$ and $a^2$ is $2a+1$, which has its smallest value (3) when $a=1$. So, consecutive squares differ by at least 3, i.e., $n$ and $n+2$ cannot both be squares, because they differ by 2. – Chris Leary Oct 23 '13 at 19:31
1

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.

Patrick
  • 2,106
-2

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