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?

Joseph O'Rourke

Posted 2017-11-29T13:14:11.320

Reputation: 4 389

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

Answers

23

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}}
*)

Michael E2

Posted 2017-11-29T13:14:11.320

Reputation: 190 928