How to solve sum of quadratics

99 Views Asked by At

For which integers $n$ does $$(t-n)^2+(t-(n-1))^2+(t-(n-2))^2+...+(t-1)^2=\sum_{i=1}^ni$$ have solutions?

I have managed to find an answer to this, but it is probably wrong (example later). Note that this is not a textbook question; rather one I've created.

Attempt

I will give a very brief answer to this.

The LHS can be written as $$\small(t^2-2nt+n^2)+((t^2-2nt+n^2)+2t-2n+1)+((t^2-2nt+n^2)+4t-4n+4)+...+((t^2-2nt+n^2)+2(n-1)t-2n(n-1)+(n-1)^2)$$ which can be simplified as $$n(t^2-2nt+n^2)+n(n-1)t-\frac16n(4n^2+9n-1)=n(t^2-(n-1)t+\frac16(2n^2-9n+1))$$ using the sum of squares. So our equation can be expressed as $$n(t^2-(n-1)t+\frac16(2n^2-9n+1))=\frac12n(n+1)$$ giving $$t^2-(n-1)t+\frac13(n^2-6n-1)=0$$ The equation has solutions if the discriminant is not less than $0$: $$b^2-4ac=(n-1)^2-\frac43n(n^2-6n-1)>0$$ when $n<7$ by Desmos.

(Counter)example

Let $n=7$. Then the equation becomes $$7t^2-56t+140=28\implies t=4$$ which is a solution. This contradicts my attempt and the result obtained by Desmos.

Can anyone spot the error in my answer?

1

There are 1 best solutions below

0
On BEST ANSWER

The LHS can be written as $$\small(t^2-2nt+n^2)+((t^2-2nt+n^2)+2t-2n+1)+((t^2-2nt+n^2)+4t-4n+4)+...+((t^2-2nt+n^2)+2(n-1)t-2n(n-1)+(n-1)^2)$$

This is correct.

which can be simplified as $$n(t^2-2nt+n^2)+n(n-1)t-\frac16n(4n^2+9n-1)$$

This is incorrect. The last term has an error.

Since we have, for $1\le j\le n$, $$\begin{align}(t-j)^2&=(t-n+n-j)^2\\\\&=(t-n)^2+2(t-n)(n-j)+(n-j)^2\\\\&=(t-n)^2+2(n-j)t-n^2+j^2\end{align}$$ we have$$\begin{align}&\sum_{j=1}^{n}((t-n)^2+2(n-j)t-n^2+j^2)\\\\&=n(t-n)^2+2\cdot\frac{n(n-1)}{2}t-n^3+\frac{n(n+1)(2n+1)}{6}\\\\&=n(t^2-2nt+n^2)+n(n-1)t-\frac 16n(4n^2\color{red}{-3}n-1)\end{align}$$


We want to find integers $n$ such that $$n(t^2-2nt+n^2)+n(n-1)t-\frac 16n(4n^2-3n-1)=\frac{n(n+1)}{2}$$ has solutions.

This is equivalent to $$3t^2+(-3n-3)t+n^2-1=0$$ and so $$t=\frac{3n+3\pm\sqrt{-3n^2+18n+21}}{6}$$ So, we have to have $$-3n^2+18n+21\ge 0\implies -1\le n\le 7$$

Therefore, if $t\in\mathbb Z$, then the answer is $$(n,t)=(1,0),(1,2),(5,2),(5,4),(7,4)$$