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:

  • The golden section method in optimization: the divine proportion at the service of the minimum
  • The dichotomous algorithm in optimization: Dividing to find the minimum
  • Uniform Search in Optimization: Measuring the Terrain Point by Point
  • KKT and duality: different mathematical paths to the same destination
  • When Variables Mix: Gomory's Mixed-Integer Cuts