What is the largest number less than a given $N$ expressible as $b^e$, where $b,e\in\mathbb N$? For $N=10$ the answer is $3^2$; for $N=18$ the answer is $2^4$. Is there a procedure to find the correct $b$ and $e$?
Here $b$,$e$>1
Note: Only $N$ is provided. $b$,$e$ are not provided as part of question or input
Given $N$ and a base $b$, it can be shown that the largest $e$ such that $b^e \leq N$ is equal to $\lfloor \log_b(N) \rfloor$. We don't know what the base is, but we can loop over different bases and see which one gives us the largest result. Thus, the largest number would be:
$$\max \{ b^{\lfloor \log_b(N) \rfloor} \mid b = 2, 3, 4 \dots ,\lfloor\sqrt{N}\rfloor \}.$$
EDIT: It suffices to only go up to $\lfloor\sqrt{N}\rfloor$ because if we pick $b > \lfloor\sqrt{N}\rfloor$, then $b > \sqrt{N}$ (since $b$ is an integer). Also, $e$ needs to be an integer bigger than 1, so $e \geq 2$. Thus, we would have $b^e > \sqrt{N}^2 = N$, a contradiction. Thus, $b$ must be no more than $\lfloor\sqrt{N}\rfloor$.