Efficient algorithm to determine all numbers having a given totient value?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
A positive integer $kge 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 $pge 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.
number-theory elementary-number-theory inverse-function totient-function
 |Â
show 2 more comments
up vote
3
down vote
favorite
A positive integer $kge 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 $pge 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.
number-theory elementary-number-theory inverse-function totient-function
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 at 21:55
See mathoverflow.net/questions/31691/inverting-the-totient-function and math.stackexchange.com/a/23955/589
– lhf
Jul 28 at 22:30
Don't know whether this fits your "efficient"-requirement (likely not) but see Max Alexejev's implementation home.gwu.edu/~maxal/gpscripts
– Gottfried Helms
Jul 29 at 2:40
@GottfriedHelms I think in the meantime I have managed to implement an effective algorithm. I used the $p-1mid k$ - idea from above and additionaly, if we define $S$ to be the set of prime numbers satisfying $p-1mid k$ and $$P:=prod_pin S fracpp-1$$ we have the inequality $nle kP$ which accelerates the search significantically.
– Peter
Jul 29 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 at 15:12
 |Â
show 2 more comments
up vote
3
down vote
favorite
up vote
3
down vote
favorite
A positive integer $kge 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 $pge 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.
number-theory elementary-number-theory inverse-function totient-function
A positive integer $kge 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 $pge 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.
number-theory elementary-number-theory inverse-function totient-function
asked Jul 28 at 20:53
Peter
44.9k938119
44.9k938119
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 at 21:55
See mathoverflow.net/questions/31691/inverting-the-totient-function and math.stackexchange.com/a/23955/589
– lhf
Jul 28 at 22:30
Don't know whether this fits your "efficient"-requirement (likely not) but see Max Alexejev's implementation home.gwu.edu/~maxal/gpscripts
– Gottfried Helms
Jul 29 at 2:40
@GottfriedHelms I think in the meantime I have managed to implement an effective algorithm. I used the $p-1mid k$ - idea from above and additionaly, if we define $S$ to be the set of prime numbers satisfying $p-1mid k$ and $$P:=prod_pin S fracpp-1$$ we have the inequality $nle kP$ which accelerates the search significantically.
– Peter
Jul 29 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 at 15:12
 |Â
show 2 more comments
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 at 21:55
See mathoverflow.net/questions/31691/inverting-the-totient-function and math.stackexchange.com/a/23955/589
– lhf
Jul 28 at 22:30
Don't know whether this fits your "efficient"-requirement (likely not) but see Max Alexejev's implementation home.gwu.edu/~maxal/gpscripts
– Gottfried Helms
Jul 29 at 2:40
@GottfriedHelms I think in the meantime I have managed to implement an effective algorithm. I used the $p-1mid k$ - idea from above and additionaly, if we define $S$ to be the set of prime numbers satisfying $p-1mid k$ and $$P:=prod_pin S fracpp-1$$ we have the inequality $nle kP$ which accelerates the search significantically.
– Peter
Jul 29 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 at 15:12
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 at 21:55
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 at 21:55
See mathoverflow.net/questions/31691/inverting-the-totient-function and math.stackexchange.com/a/23955/589
– lhf
Jul 28 at 22:30
See mathoverflow.net/questions/31691/inverting-the-totient-function and math.stackexchange.com/a/23955/589
– lhf
Jul 28 at 22:30
Don't know whether this fits your "efficient"-requirement (likely not) but see Max Alexejev's implementation home.gwu.edu/~maxal/gpscripts
– Gottfried Helms
Jul 29 at 2:40
Don't know whether this fits your "efficient"-requirement (likely not) but see Max Alexejev's implementation home.gwu.edu/~maxal/gpscripts
– Gottfried Helms
Jul 29 at 2:40
@GottfriedHelms I think in the meantime I have managed to implement an effective algorithm. I used the $p-1mid k$ - idea from above and additionaly, if we define $S$ to be the set of prime numbers satisfying $p-1mid k$ and $$P:=prod_pin S fracpp-1$$ we have the inequality $nle kP$ which accelerates the search significantically.
– Peter
Jul 29 at 12:11
@GottfriedHelms I think in the meantime I have managed to implement an effective algorithm. I used the $p-1mid k$ - idea from above and additionaly, if we define $S$ to be the set of prime numbers satisfying $p-1mid k$ and $$P:=prod_pin S fracpp-1$$ we have the inequality $nle kP$ which accelerates the search significantically.
– Peter
Jul 29 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 at 15:12
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 at 15:12
 |Â
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2865564%2fefficient-algorithm-to-determine-all-numbers-having-a-given-totient-value%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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 at 21:55
See mathoverflow.net/questions/31691/inverting-the-totient-function and math.stackexchange.com/a/23955/589
– lhf
Jul 28 at 22:30
Don't know whether this fits your "efficient"-requirement (likely not) but see Max Alexejev's implementation home.gwu.edu/~maxal/gpscripts
– Gottfried Helms
Jul 29 at 2:40
@GottfriedHelms I think in the meantime I have managed to implement an effective algorithm. I used the $p-1mid k$ - idea from above and additionaly, if we define $S$ to be the set of prime numbers satisfying $p-1mid k$ and $$P:=prod_pin S fracpp-1$$ we have the inequality $nle kP$ which accelerates the search significantically.
– Peter
Jul 29 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 at 15:12