4

A positive integer $k\ge 1$ is given. The object is to find all positive integers $n$ with $\varphi(n)=k$

Is there an EFFICIENT algorithm to determine the set of numbers ?

It is clear that we can rule out prime factors $p\ge k+2$ and that we can also bound the exponents corresponding to all possible prime factors. But this brute force method is very slow. Is there a trick to get the set faster ? In particular nice would be an implementation in PARI/GP.

If I remember right, I asked a question about whether the set can be determined in a finite amount of time (which obviously is the case), but I am not sure whether I also asked for an efficient method. If so, I apologize for the duplicate.

Peter
  • 86,576
  • This is a nice question. I suspect the answer is "no". My next improvement for the brute force method would be to factor $k$ and collect those primes such that $p-1$ divides $k$. Such an approach does not lower the complexiity to below $O(k \log k)$ though, which is quite slow. – davidlowryduda Jul 28 '18 at 21:55
  • See https://mathoverflow.net/questions/31691/inverting-the-totient-function and https://math.stackexchange.com/a/23955/589 – lhf Jul 28 '18 at 22:30
  • Don't know whether this fits your "efficient"-requirement (likely not) but see Max Alexejev's implementation https://home.gwu.edu/~maxal/gpscripts/ – Gottfried Helms Jul 29 '18 at 02:40
  • @GottfriedHelms I think in the meantime I have managed to implement an effective algorithm. I used the $p-1\mid k$ - idea from above and additionaly, if we define $S$ to be the set of prime numbers satisfying $p-1\mid k$ and $$P:=\prod_{p\in S} \frac{p}{p-1}$$ we have the inequality $n\le kP$ which accelerates the search significantically. – Peter Jul 29 '18 at 12:11
  • Peter, why not putting this as an answer and close-the-case by "accepting" it?(Also I'm curious to see your formula more explicite :) ) – Gottfried Helms Jul 30 '18 at 15:12
  • @GottfriedHelms The method has a catch, namely that it needs the divisors of numbers and such vectors can have vastly many entries. – Peter Jul 31 '18 at 11:17
  • ah, well; I think I've seen a "divisors"-expression in Alexejev's script too. He has also an estimate for the complexity/time-consumption, I think t remember... – Gottfried Helms Jul 31 '18 at 16:34

0 Answers0