Problem

Source: 2020 Thailand October Camp 4.3

Tags: number theory, Sequence



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$.