(4)
A useful formula, here and in the following, is
∑
n
=1
N
n
2
=
N
(
N
+ 1)(2
N
+ 1)
∕
6.