Square pyramidal numbers
Python 2, 22 bytes



lambda n:n*~n*~(n*2)/6


Try it online!

This uses the closed-form formula n * (n+1) * (2*n+1) / 6. The code performs the following operations:


Multiplies n by (n*):


The bitwise complement of n (~n), which essentially means -1-n. 
And by the bitwise complement of 2n (*~(n*2)), which means -1-2n.

Divides by 6 (/6).


Python 2, 27 bytes



f=lambda n:n and f(n-1)+n*n


Try it online!

Saved 1 byte thanks to Rod and 1 thanks to G B.