Like the title says, I'm trying to make a program that finds the highest natural radix of a given number with a natural output. My program works, but it loops every number possible number up to a certain limit, which can give obvious problems and performance issues.
Example (let's say the limit is 1000, so it loops from base 2-1000):
Log7(117649) = 6 |Base = 7 -->OK
Log49(117649) = 3 |Base = 49 -->OK
Log343(117649) = 2 |Base = 343 -->OK (highest)
Log6(117649) = 6.516198795 |Base = 6 -->Wrong because output is not a natural number
From the example you see that base 343 is the highest base possible.
Now I was wondering if there's a way to find the numbers 7-49-343. Or even just one of them without doing it my way(which is just looping through numbers) Is there some formula or rule I'm missing? Any suggestion on how to tackle this in a different way is very much appriciated.