## InverseTotient[ ]?

15

2

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?

3

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.

– KennyColnago – 2017-11-29T17:10:07.963

23

Perhaps:

ReduceEulerPhiInverse[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}}
*)
`