I'm not sure if you've got this problem solved or not. (And I am deliberately loathe to provide code as this would defeat the whole purpose of the question.)

Here is your method rewritten with a more descriptive method name:

Code:

`static long sumOfSquaresUpTo(int n) {`

if(n == 0)

return 0; //base case

else {

return (n*n) + sumOfSquaresUpTo(n-1) *(n-1);

}

And I'm wondering if you can see why that last multiplication is wrong.

After all the-sum-of-squares-up-to n is just n squared plus the-sum-of-squares-up-to (n-1).