That won't work, 'cause 4*9 would be 17 not 21.
A variation to that theme which would work is: if second number is smaller, then [first number] + twice [second number], else, [first number] + twice second number] - 1. That is quite inelegant, and does not solve for instance of both numbers the same. Back to thinking further outside cube.