MAGIC SQUARE
三阶幻方,横竖斜都是 15。
每行、每列、每条对角线之和都等于 15。随机挖空,填好后自动判分,附经典洛书。
本页处理在浏览器本地完成
解题动画 · 罗伯法造洛书
这是什么?
三阶幻方(洛书)把 1–9 填入九宫,使每行、每列、两条对角线之和都为 15。系统随机旋转/翻转后挖空几格,填对即判分。
常见问题
三阶幻方为什么每行都是 15?
因为 1–9 总和是 45,45 ÷ 3 = 15。三行加起来就是全盘,每行必须相等所以每行都是 15;四行(列)、两条对角线同理。这解释了为什么中心必须是 5——行列对角线都过中心,平均值落在中心。
洛书的经典写法是什么?
经典洛书是:4 9 2 / 3 5 7 / 8 1 6。口诀「戴九履一,左三右七,二四为肩,六八为足,五居中央」,其中「五居中央」说的就是中心必为 5。本工具会随机旋转或翻转后再挖空,所以每局的题面都不一样。
练习时卡住了有提示吗?
可以点提示逐步填入正确的数字。判断填对后才会判分,建议先自己推一遍再看提示——幻方的规律(中心为 5、相对两数和为 10)掌握后完全不需要提示就能秒填。
示例与注意事项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
- 三阶幻方的中心必为 5、幻和必为 15,可用来快速自检。A 3×3 magic square always has 5 in the centre and sums to 15 — a quick sanity check.
- 这套口诀只适用于奇数阶;四阶要用对角交换法。The recitation only works for odd orders; order 4 needs the diagonal-swap method.
- 旋转和镜像视为同一个幻方,统计解法数量时要去重。Rotations and reflections count as the same square when enumerating solutions.
相关问答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.