The sum of the distances to N points on a sphere