Enter an equation or problem
Camera input is not recognized!

Magic square solver

Magic square solver

Learn more with Tiger

A magic square is a square grid of distinct positive integers arranged so that every row, every column, and both main diagonals all sum to the same number -- the magic constant.

Key Facts

  • For an n×n magic square using the integers 1 to n2, the magic constant is M=n(n2+1)2.
  • A 3x3 magic square has M=15; a 4x4 has M=34.
  • The center cell of a 3x3 magic square always equals M3=5.

Worked Example

Complete the 3x3 magic square:

_ 1 _ / _ 5 _ / _ 9 _

Solution: 6 1 8 / 7 5 3 / 2 9 4 (every line sums to 15).

Why It Matters

  • Develops logical reasoning and constraint-satisfaction thinking
  • Appears in recreational mathematics, combinatorics, and puzzle competitions
  • Historical significance in number theory (Lo Shu square, Albrecht Dürer)

Try It

Enter a partial magic square like _,1,_,_,5,_,_,9,_ or specify the size and known values to get a step-by-step solution.



Teacher review: Magic square solver

  1. Name the given values and the unknown before calculating.
  2. Apply the core rule: for a normal n×n magic square, the magic sum is n(n2+1)2.
  3. Check the answer in the original problem, not only in the simplified line.

Example

for n=3, each row, column, and diagonal sums to 15. Compare the solver steps with the rule above before trusting the final answer.

Latest Related Drills Solved