Integer chemistry II
\[ 6 = 1+1+1+1+1+1 \\ = (1+1)*(1+1)+1+1 \\ = (1+1)*(1+1+1) \]
We say the number 6 has complexity 5, because that's the cheapest (using the fewest ones) way it can be built. The allowed operations are addition, multiplication and brackets. It's not allowed to write two ones next to each other to make 11.
What's the complexity of the number 31?