I need help regarding the following question:

Four different integers are in A.P. One of these integers is equal to the squares of the rest integers. Find the numbers.

It is like this:

If a, b, c, d are in A.P. then d=a^2 +b^2 +c^2

I know the answer, but I simply can't figure out the explanation. The A.P. is -1,0,1,2

But I do not understand how it came.

Any help will be appreciated.