# Proof by contradiction problem, translating problem to logical statement

Problem: The only consecutive non-negative integers a,b and c that satisfy $a^2+b^2=c^2$ are $3,4$ and $5$.

Firstly, How can i turn this into logical statement?
Let $a,b$ and $c$ are consecutive

is it

1. $a \in \mathbb N, a^2+b^2=c^2 \implies a = 3$

or

1. $a \in \mathbb N, a = 3 \implies a^2+b^2=c^2$

I think first one is true, but i have a little confusion..

Then how can i prove it by contradiction?
My attempt:
we know $[(P'\implies q ) \land q' ] \implies P$
we want to show that $a^2+b^2 \ne c^2 \implies a=3$ is wrong

we get
$a^2 - 2a - 3 = (a-3)\cdot(a+1) \ne 0 \implies a\ne 3$
This completes proof, right?

• @MauroALLEGRANZA why did you add $\forall x, y, z$? There is only one $(x,y,z)$ tuple which is $(3,4,5)$ – Salih Oct 28 '16 at 12:28
• We may use only $a$, provided that we add the constraint : $b=a+1 \land c=b+1$. – Mauro ALLEGRANZA Oct 28 '16 at 12:28
• Because you have to prove that the only solution (with $b=a+1, c=b+1$) is $a=3$; thus : $\forall a \ [a^2+(a+1)^2=(a+2)^2 \to a=3]$. – Mauro ALLEGRANZA Oct 28 '16 at 12:30

## 1 Answer

You want $a,b,c$ to be consecutive, so

$$a+2=b+1=c.$$

Then your problem can be written

$$a^2+b^2=c^2\text{ and } a+2=b+1=c\implies (a,b,c)=(3,4,5).$$

Edit To answer your other question.

This completes the proof because you are look for non negative integers.

Though there is no need for contradiction here, once you have $(x-3)(x+1)=0$ then you get $a=3$ or $a=-1$, but the case $a=-1$ can be excluded because you are looking for non negative integers.

• @E.Joseph thanks for your answer. This completes first part of the question. I will write my attempt for second part now. – Salih Oct 28 '16 at 12:44
• In general, is there anything wrong with my approach? Or maybe using '$\implies$' sign etc? – Salih Oct 28 '16 at 12:57
• @Salih Nothing is wrong, but you should avoid contradiction when you can to gain in clarity. And about the sign $\implies$, you should only use it when you are writing formally, and avoid it when you are using english words. – E. Joseph Oct 28 '16 at 13:00