prime number remainder rule