How to find the residue at a pole of order N