ThePerfectHacker gave you the formula for this problem.
If you're not familiar with it, you could derive it,
. . but it's faster to simply add the ninety-eight squares!
For anyone who is interested, here is one method.
List the first few partial sums.
Take differences of consecutive pairs of the numbers.
Take differences of the differences, and so on
. . until you reach a row of constant differences.
. . .
. . . . .
. . . . . .
The constants appeared in the third differences.
Hence, the generating function is of the third degree (a cubic).
The general form of a cubic is: .
We know the first four sums of the sequence; plug them in.
Therefore, the function is: .