/* ** invphi.gp ver. 1.0 (c) 2005,07 by Max Alekseyev ** ** invphi(n) computes all solutions to the equation eulerphi(x)=n with respect to x. ** numinvphi(n) computes the number of such solutions and is faster than #invphi(n). */ { numinvphi(n,m=1) = local(s=0,k,p); if(n==1,return(1+(m<2))); fordiv(n,d, if(d