Extraction of the spurious states from the solution of the motion equation within the random phase approximation