MAGIC SQUARE

Magic square, all lines sum to 15.

Every row, column and diagonal sums to 15. Random fill-in quizzes with auto-grading, plus the classic Lo Shu square.

8
3
9
6
7
2

Most tools process data locally; see this page for details

Solution animation · Siamese method

1 sits top-middle: place 1 at row 1, col 2

What is this?

A 3×3 magic square (Lo Shu) places 1–9 so every row, column and diagonal sums to 15. We randomly rotate/reflect it and blank a few cells for you to fill.

FAQ

Why is every row in a three-order magic square 15?

Because 1–9 sum to 45 and 45 ÷ 3 = 15. The three rows make up the whole grid and each must be equal, so each is 15; the four columns and two diagonals follow the same logic. That also explains why the centre must be 5: the rows, columns and diagonals all pass through the middle, so the average sits there.

What is the classic Luoshu arrangement?

The classic Luoshu is 4 9 2 / 3 5 7 / 8 1 6. The mnemonic goes: wear nine on the crown, tread one beneath, three on the left, seven on the right, two and four form the shoulders, six and eight the feet, and five rests in the centre. The tool rotates or mirrors the square randomly before blanking cells, so no two rounds look alike.

Is there a hint when I get stuck?

Yes — the hint fills in correct digits progressively. Scoring only happens once the grid is correct, so try to reason it out before asking. In practice you never need a hint: knowing the centre is 5 and that opposite pairs sum to 10 is enough to fill the whole square.

示例与注意事项Example & notes

一个例子A worked example

用罗伯法填 1–9:从顶部中间开始,每次都往右上走,出上边回到最下边、出右边回到最左边,遇阻则下移一格,最终每行每列每条对角线和都是 15。Fill 1–9 by the Siamese method: start top-centre, always move up-right, wrap around the edges, and drop one cell when blocked. Every line then sums to 15.

注意事项Things to watch

相关问答More Q&A

幻和怎么算?How is the magic sum computed?

n 阶幻和 = n×(n²+1)/2;三阶即 3×10/2 = 15。For order n it is n×(n²+1)/2 — for order 3 that is 3×10/2 = 15.

四阶幻方也能填吗?Can it build a 4×4 square?

可以,但要用对角交换法,罗伯法口诀不适用。Yes, with the diagonal-swap method — the Siamese recitation does not apply.

Further reading

觉得好用?Found it useful?