[Solved] Given an integer, w, find n and k such that n^k = w [closed]
[ad_1] You can try k >= 2 and limit N with sqrt(w), start i with 2 in the loop. If solution is not found then k = 1, n = w. Also you do not need pow, you could multiply intermediate product by N on each iteration. [ad_2] solved Given an integer, w, find n … Read more