The above script will calculate the minimum number of “1”-s to be used. What I especially like is that the internal record of the underlying calculation is immediately translated into a Snap! -readable script.

I’m aware that finding the shortest calculation (i.e. with a little “1”-s as possible) including @ten_6044 ’s other operators (- / ^ mod) is very much more difficult - I don’t think I could pull it off, with target numbers even from 50 or so.

this reminds me of a thing i made where you represent any integer with two functions and one value: 2^x, x-y, and 0. for example, one way you could represent 5677 would be 2^(2^2^2^2^0-(2^2^2^0-(2^0)))-(2^(2^2^2^2^0-2^2^2^0)-(2^(2^2^2^2^0-(2^((2^2^2^0-2^0))-(2^2^2^0-2^0)))-(2^(2^2^2^2^0-(2^((2^2^2^0-2^0))-2^0))-(2^(2^((2^2^2^0-2^0))-2^2^0)-(2^(2^((2^2^2^0-2^0))-(2^2^2^0-(2^0)))-(2^2^2^2^0-(2^2^2^0-(2^0))))))))