Python 3, 28 bytes
(Assuming code-golf is the winning criteria, but also efficient at O(1).)
lambda n:n*~-n*-~n*(n/4+1/6)
Python 2, 29 bytes: lambda n:n*~-n*-~n*(3*n+2)/12
(Assuming code-golf is the winning criteria, but also efficient at O(1).)
lambda n:n*~-n*-~n*(n/4+1/6)
Python 2, 29 bytes: lambda n:n*~-n*-~n*(3*n+2)/12