Solving the Number Sums board using mathematical optimization

Image by Cooper Hofmann retrieved from Unsplash

Number Sums is a numeric logic puzzle played on a matrix board. Each row and column features a clue value located in its margins. The goal is to select a subset of numbers from the grid such that the sum of the selected values in each row and column matches all the clues on the board exactly and simultaneously.

Below is an example board of size $8 \times 8$:

Can you select the correct numbers before checking the binary programming model?


The Number Sums game can be formulated directly as a binary linear optimization problem.


Want to keep exploring the world of Operations Research? Discover more posts on the topic here.




If you found this useful, please cite this as:

Martín-Campo, F. Javier (Jul 2026). Solving the Number Sums board using mathematical optimization. https://www.fjmartincampo.com/blog/2026/numbersums/.

or as a BibTeX entry:

@misc{martín-campo2026solving-the-number-sums-board-using-mathematical-optimization,
  title   = {Solving the Number Sums board using mathematical optimization},
  author  = {Martín-Campo, F. Javier},
  year    = {2026},
  month   = {Jul},
  url     = {https://www.fjmartincampo.com/blog/2026/numbersums/}
}



Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • A crime has been committed... in a sudoku!
  • The harmony of digits in solving Kakuro
  • Killer Sudoku, the empty board challenge that math can solve
  • Building bridges with linear optimization, the Hashi puzzle
  • The knight's perfect tour, challenge chess with linear optimization