question
What numbers smaller than $28$ can be values of the expression $E=a^2+b^2+c^2-ab-bc-ca$, where $a<b<c$ are prime numbers?
my idea
We have to solve the following inequality
$a^2+b^2+c^2-ab-bc-ca=28 |*2$
$2a^2+2b^2+2c^2+2ab+2ac+2bc<56$
$(a-b)^2+(b-c)^2+(a-c)^2<56$
because $a<b<c$, $(a-c)^2$ is the greatest number in the inequality.
Also, because the numbers are perfect squares, we can say that $0<(a-b)^2+(b-c)^2+(a-c)^2<56$
I know that from now I can simply start doing tries, but I am looking for pure algebra.
Hope one of you can help me! Thank you!
You have correctly said that $(c-a)^2$ is the greatest number in the LHS of $(b-a)^2+(c-b)^2+(c-a)^2<56$.
Now since $$(c-a)^2\lt (b-a)^2+(c-b)^2+(c-a)^2\lt 56$$ we have to have $(c-a)^2\lt 56$ which implies $c-a\lt 8$.
Let us separate it into two cases :
If $a=2$, then it follows from $c-a\lt 8$ that $c\le 7$ where $c$ is a prime number. So, $(a,b,c)=(2,3,5),(2,3,7),(2,5,7)$.
If $a\ge 3$, then $a,b,c$ are odd. So, $b-a,c-b,c-a$ are even. Since $2\le b-a\lt c-a\le 6$ and $2\le c-b\lt c-a\le 6$, we have three cases to consider.
Case 1 : $(b-a,c-b,c-a)=(2,2,4)$
Suppose that the remainder is $1$ when $a$ is divided by $3$. Then, $b=a+2$ is divisible by $3$. Since $3$ is the only prime number divisible by $3$, we have to have $b=3$, and then $a=1$ which is not a prime number. So, the remainder is not $1$. Suppose that the remainder is $2$ when $a$ is divided by $3$. Then, $c=a+4$ is divisible by $3$. So, $c=3$, and then $b=1$ which is not a prime number. So, the remainder is not $2$. Therefore, the remainder has to be $0$ when $a$ is divided by $3$, which means that $a$ has to be $3$. So, $(a,b,c)=(3,5,7)$.
Case 2 : $(b-a,c-b,c-a)=(2,4,6)$
We have $(b-a)^2+(c-b)^2+(c-a)^2=56$ which contradicts that $(b-a)^2+(c-b)^2+(c-a)^2\lt 56$.
Case 3 : $(b-a,c-b,c-a)=(4,2,6)$
We have $(b-a)^2+(c-b)^2+(c-a)^2=56$ which contradicts that $(b-a)^2+(c-b)^2+(c-a)^2\lt 56$.
Therefore, the only solutions are $$\color{red}{(a,b,c,E)=(2,3,5,7),(2,3,7,21),(2,5,7,19),(3,5,7,12)}$$