Take this puzzle of mine I created recently:
Let $f(x)=x+1$, $g(x)=x^2-1$, $h(x)=2x-4$. Starting with $x=0$ and applying these functions as needed, what is the minimum amount of times that you will need to apply $f$, $g$ and $h$ to get the number $524261$?
Total: 122889 functions
- Apply $h$ once to get $-4$ (total: 1 function)
- Apply $g$ thrice to get $50175$ (total: 4 functions)
- Apply $h$ thrice to get $401372$ (total: 7 functions)
- Since there is nothing we can do now other than apply $f$, we apply it a total of $122889$ times to get $524261$ (total: 122896 functions)
However, my question is: Can YOU figure out the true minimum amount of times you will need to apply the functions $f$, $g$ and $h$ to get $524261$, or is this truly the most efficient solution to the puzzle?
Hint (if and only if you are struggling):
The first two steps are correct (in order also!) however apply $g$ 2 less times.
Don't worry I know the answer :D also sorry for the lack of efficiency in my attempt that I showed, but at least it wasn't peak inefficiency with $\infty$ total functions