High Level Math Question!

It seems you are correct!

This might be useful for anyone trying to do something using the least amount of wires. (keypads..).