Prime and none prime

unable to understand how the steps are being followed