sieve method to solve the totient function