2025 08 28 First Discussion

Imagine you can call only the following three functions:

  • f(x): Subtracts one from an integer x. For example, f(5) is 4.
  • g(x): Adds one and then doubles an integer x. For example, g(5) is 12.
  • h(x, y): Concatenates the digits of two different positive integers x and y. For example, h(789, 12) evaluates to 78912 and h(12, 789) evaluates to 12789.

Definition: A small expression is a call expression that contains only fgh, 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))