Partial sums of the cotangent function