A number of years ago I attempted to create a program that would exhaustively evaluate short, digitless "dc" programs to find the shortest programs for all numbers under a million: https://emergent.unpythonic.net/01518231512 & a database of all my results for numbers up to 1 million: https://emergent.unpythonic.net/01525128151
While dc does have looping and function calls, my program didn't investigate their use; only straight-line dc programs are checked.
(dc is an rpn calculator available on many unix systems)
It's sad that things like this are nearly impossible to find on Google unless you already know the exact title.
Set your location in the upper-right corner, then select the ACS3 on the main page.