Number puzzle solver