# MATHCOUNTS States Team Problem #9 2018 (Sum of Terms are Squares)

I've made it to states this year, but I want to know how to solve this problem. I already know since the difference between consecutive squares are changing by $2,$ I should be doing something similar in my sequence.

If a certain sequence $a_1, a_2, a_3, a_4, …$ of positive integers has the following properties, what is the greatest possible value of $a_{99}$?
For every positive integer $k,$ $a_k$ < $a_{k+1}.$
For every positive integer $k > 3,$ $a_{k− 3} + a_{k − 2} + a_{k − 1} + a_k = k^2.$

I've reduced the problem to finding the maximum of $a_6,$ noting that there (probably) is some kind of square pattern (that I don't get), and even testing is difficult because I often get into a contradiction when I try to minimize $a_6.$

• Can you use the fact that $a_k-a_{k-4}=2k-1$? So that you should maximize $a_3$? Sep 4, 2018 at 5:07

For $k>4$, we have $a_{k-4}+a_{k-3}+a_{k-2}+a_{k-1}=(k-1)^2$. Subtracting the 2 equations gives

$$a_k-a_{k-4}=k^2-(k-1)^2=2k-1$$ $$a_k=a_{k-4}+2k-1$$

So $a_7=a_3+13,a_{11}=a_3+13+21$,etc. So

$$a_{4\times24+3}=a_3+\sum_{i=1}^{24}[2(4i+3)-1]$$ $$a_{99}=a_3+\sum_{i=1}^{24}(8i+5)=a_3+8\sum_{i=1}^{24}i+120$$ $$a_{99}=a_3+4(24)(25)+120=a_3+2520$$

To maximize $a_{99}$, we then need to maximize $a_3$. We have $a_1+a_2+a_3+a_4=16$. If we want to maximize $a_3$, we should make $a_1,a_2,$ and $a_4$ as small as possible. So $a_1=1,a_2=2,$ and $a_4=a_3+1$. This gives $a_3=6$ and $a_{99}=2526$

• $4\times 22$ is $88$, not $98$ :) Sep 4, 2018 at 13:51
• @SteveD Sorry about that. I think I've made the relevant corrections, but let me know if I missed one.
– Mike
Sep 5, 2018 at 5:55