I'm not familiar with your terminology of homogeneous and nonhomogeneous parts, so I can't answer exactly what's wrong with your approach, except for saying that when your sequence looks like $\sum p(k)$ for a polynomial $p$ of degree $d$, then you should expect your sequence to be given by a polynomial of degree $d+1$.
The reason is probably easier to appreciate when $d$ is small. For example suppose $a_n=\sum_{k=1}^n1$. Obviously $a_n$ is just $n$, which is a polynomial of degree $1$. Each additional summand has degree $0$ (it is the constant $1$), but since we are taking the cumulative sum of all the summands, the result ends up with something that grows faster and has degree $1$. Similarly, if $a_n=\sum_{k=1}^nk$, then $a_n=n(n+1)/2$ is given by a quadratic polynomial. This is because each successive summand is linear, which makes the growth rate of $a_n$ faster than that and in particular becomes a quadratic.
So for your case $$a_n=\sum_{k=1}^nk^2,$$ you should be expecting a cubic polynomial as the resulting closed form expression for $a_n$. So let $a_n=c_0+c_1n+c_2n^2+c_3n^3$, and then go from there.
$a_{n-1} = 1 + ... + (n-1)^2$
– alladinsane Nov 08 '19 at 10:50