Naive solution to totient function