Suppose I have an integer sequence $\{a_k\}$, and suppose I know a closed form in terms of $n$ for this sum:
$$\displaystyle\sum\limits_{k=1}^{n} a_k$$
Given this, is it always (or ever) possible to find a closed form in terms of $n$ for
$$\displaystyle\sum\limits_{k=1}^{n} a_k^2$$
or to say anything about this sum?
If not, what special cases allow us to extend the closed form to the sum of squares in some way?