2

How would I determine all values of n in ϕ(n) = x for any value of x where ϕ is Euler's totient function? (and -1 if x is not a totient). Is there a simple formula for this? Or is this a lot more complicated than I think this is? Simply trying every number from x + 1 to the upper limit is too inefficient. I will be using numbers up to 1,000,000,000,000, so efficiency is key here.

  • 1
    Seems like the latter ... see e. g. here – martini Oct 19 '15 at 14:44
  • 1
    You may find some idea how to do this for some given $x$ from various older posts on this site. For example: http://math.stackexchange.com/questions/1126844/eulers-function-phi-values-such-that-phin-8-phin-14 and http://math.stackexchange.com/questions/761014/solving-phin-84 (And a few more posts are linked in the sidebar among related questions.) – Martin Sleziak Oct 19 '15 at 15:06

1 Answers1

3

The paper below proves that it is very unlikely that this problem can be solved efficiently:

"Complexity of Inverting the Euler Function" by Scott Contini, Ernie Croot and Igor E. Shparlinski, published in Mathematics of Computation (doi, arxiv)

lhf
  • 216,483