Given an integer n n , how hard is it to find the set of all integers m m such that φ ( m ) = n \varphi (m) = n , where φ \varphi is the Euler totient function? We present a certain basic algorithm which, given the prime number factorization of n n , in polynomial time “on average” (that is, ( log n ) O ( 1 ) (\log n)^{O(1)} ), finds the set of all such solutions m m . In fact, in the worst case this set of solutions is exponential in log n \log n , and so cannot be constructed by a polynomial time algorithm. In the opposite direction, we show, under a widely accepted number theoretic conjecture, that the Partition Problem, an NP-complete problem, can be reduced in polynomial (in the input size) time to the problem of deciding whether φ ( m ) = n \varphi (m) = n has a solution, for polynomially (in the input size of the Partition Problem) many values of n n (where the prime factorizations of these n n are given). What this means is that the problem of deciding whether there even exists a solution m m to φ ( m ) = n \varphi (m) = n , let alone finding any or all such solutions, is very likely to be intractable. Finally, we establish close links between the problem of inverting the Euler function and the integer factorization problem.
Read full abstract