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.

7
9
5
1
4
3

Everything runs locally in your browser

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.

示例与注意事项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?