2025 08 28 First Discussion
Imagine you can call only the following three functions:
f(x): Subtracts one from an integerx. For example,f(5)is 4.g(x): Adds one and then doubles an integerx. For example,g(5)is 12.h(x, y): Concatenates the digits of two different positive integersxandy. For example,h(789, 12)evaluates to78912andh(12, 789)evaluates to12789.
Definition: A small expression is a call expression that contains only f, g, h, the number 5, and parentheses. All of these can be repeated. For example, h(g(5), f(f(5))) is a small expression that evaluates to 123.
What's the shortest small expression you can find that evaluates to 2025?
h(20, 25)
h(20, h(2, 5))
h(20, h(f(f(f(5))), 5))
h(g(9), h(f(f(f(5))), 5))