Comment Comment by lokedhs There is an error in the squares formula as well. The correct formula is: (n*(n+1)*(2*n+1))/6. parent lokedhs 8 years ago