totient method to find remainder - Search