>From Wht I can understand from problm to check whether N can be
expressed a m^n : Eg: 1331=11^3
What comes to my mind is to get all prime factors from 2 to SQRT(N)
[Prime Sieve] , Here N is the Given Integer .
Now Iterate over the prime number(p) from 2 to Sqrt(N)
do
T=N;
if(!(T%p)) while(!(T%p)) T/=p;
if(T==1) {printf("Yes possible");break;}
done
if (p>Sqrt(N)) printf("Not Possible");
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.