You are viewing a single comment's thread. Return to all comments →
The solution is not unique. For the given sample test case of 15, we have the following:
n^1 * n^1 = n^2
n^2 * n^2 = n^4
n^4 * n = n^5
n^5 * n^5 = n^10
n^10 * n^5 = n^15
So, how are we supposed to know which version to print? So I think this is not properly solvable.
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #122: Efficient exponentiation
You are viewing a single comment's thread. Return to all comments →
The solution is not unique. For the given sample test case of 15, we have the following:
n^1 * n^1 = n^2
n^2 * n^2 = n^4
n^4 * n = n^5
n^5 * n^5 = n^10
n^10 * n^5 = n^15
So, how are we supposed to know which version to print? So I think this is not properly solvable.