15
$\begingroup$

Maple has a function InverseTotient( c ), which returns all those natural numbers $n$ whose Euler totient function $\phi( n ) = c$. Is there an equivalent inverse of EulerPhi[ ] in Mathematica? If not, what would be a good method for computing the inverse totient, faster than just trying all possibilities?

$\endgroup$
  • 3
    $\begingroup$ The hidden inverse totient function revealed by @MichaelE2 was a welcome surprise! (+1). For more information please see the CNT.m package in the Computational Number Theory book by Bressoud and Wagon. Also see the notebook by Maxim Rytin. $\endgroup$ – KennyColnago Nov 29 '17 at 17:10
23
$\begingroup$

Perhaps:

Reduce`EulerPhiInverse[6]
(*  {7, 9, 14, 18}  *)

Not sure why such things are hidden & undocumented, perhaps because it's available through Reduce and Solve:

Solve[EulerPhi[x] == 6, x, Integers]
(*
  {{x -> -18}, {x -> -14}, {x -> -9}, {x -> -7},
   {x -> 7}, {x -> 9}, {x -> 14}, {x -> 18}}
*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.