A finite sequence of integers $a_0,,a_1,\dots,a_n$ is called quadratic if for each $i\in\{1,2,\dots n\}$ we have the equality $|a_i-a_{i-1}|=i^2$. $\text{(i)}$ Prove that for any two integers $b$ and $c$, there exist a positive integer $n$ and a quadratic sequence with $a_0=b$ and $a_n = c$. $\text{(ii)}$ Find the smallest positive integer $n$ for which there exists a quadratic sequence with $a_0=0$ and $a_n=2021$.
Problem
Source: 2020 Thailand October Camp 4.3
Tags: number theory, Sequence
24.02.2022 18:09
24.02.2022 21:03
Fasolinka wrote: we actually can subtract two times the sum of some perfect squares from $1^2 +\cdots +21^2$ to get $2021$: $1^2 +\cdots +21^2-2(21^2+20^2+17^2+12^2+4^2)=2021.$ It's wrong; a correct equality might be $1^2 +\cdots +21^2-2(17^2+16^2+10^2)=2021.$
31.05.2022 05:36
I want solution for part (i)
31.05.2022 16:06
i) We have $a_0=b, a_n=\pm n^2 \pm (n-1)^2 \pm \cdots \pm 2^2 \pm 1^2+b$ So enough to prove that for some $n$ we have $a_n=c$ or $c-b=\pm n^2 \pm (n-1)^2 \pm \cdots \pm 2^2 \pm 1^2$ Note that $(k+3)^2-(k+2)^2-(k+1)^2+k^2=4$ Also we have $0=(1^2-2^2-3^2+4^2)-(5^2-6^2-7^2+8^2),1=1^2,2=1^2-2^2+3^2-(4^2-5^2-6^2+7^2),3=-1^2+2^2$ So easy to show, that every integer can be presented as $c-b=4m+r$ where $r=0,1,2$ or $3$ and $4m=\frac{m}{|m|} \left( \left(k^2-(k+1)^2-(k+2)^2+(k+4)^2\right)+\left((k+5)^2-(k+6)^2-(k+7)^2+(k+8)^2\right)+...+((k+4m-3)^2-(k+4m-2)^2-(k+4m-1)^2+(k+4m)^2)\right)$