Finding residues using formulae.