Extract totient function