幻方是一個由不同的正整數 1, 2, ..., 組成的平方陣列,排列方式使得任何水平、垂直或主 對角線上的 個數字之和始終是相同的數字(Kraitchik 1942, p. 142; Andrews 1960, p. 1; Gardner 1961, p. 130; Madachy 1979, p. 84; Benson and Jacoby 1981, p. 3; Ball and Coxeter 1987, p. 193),稱為幻和
如果從 中減去幻方中的每個數字,則得到另一個幻方,稱為互補幻方。由從 1 開始的連續數字組成的方陣有時被稱為“標準”幻方。
三階唯一標準幻方為古代中國人所知,他們稱之為洛書 。底行相鄰中間列數字為 15 和 14 的 4 階幻方版本稱為丟勒幻方 。上面顯示了 3 階到 8 階的幻方。
對於以整數 開頭且條目為遞增的公差為 的等差數列 的 階通用幻方的幻和 為
(Hunter 和 Madachy 1975)。
確定任意階幻方的數量是一個未解問題,但階數為 、2、... 的不同幻方(不包括透過旋轉和反射獲得的幻方)的數量分別為 1、0、1、880、275305224、... (OEIS A006052 ; Madachy 1979, p. 87)。弗renicle de Bessy 在 1693 年枚舉了 880 個四階幻方,並在 Berlekamp et al. (1982, pp. 778-783) 中進行了說明。R. Schroeppel 於 1973 年計算了 幻方的數量。 階幻方的數量尚不清楚,但 Pinn 和 Wieczerkowski (1998) 使用蒙特卡羅模擬和統計力學方法估計其數量為 。Berlekamp et al. (1982) 和 MathPages 網站討論了列舉幻方的方法。
如果一個方陣未能成為幻方僅僅是因為一個或兩個主對角線之和不等於幻和 ,則稱其為半幻方 。如果幻方的所有 對角線(包括透過環繞獲得的對角線)之和都等於幻和 ,則該方陣被稱為泛幻方 (也稱為完全幻方或pandiagonal square)。如果將每個數字 替換為其平方 後產生另一個幻方,則該方陣被稱為雙重幻方 (或二重幻方)。如果一個方陣對於 、 和 都是幻方,則它被稱為三重幻方 (或三階幻方)。如果所有關於中心對稱位置的數字對之和都為 ,則該方陣被稱為結合幻方 。
可以使用乘法而不是加法構造幻方,稱為乘法幻方 。此外,可以構造在加法和 乘法下都是幻方的方陣,稱為加法-乘法幻方 (Hunter 和 Madachy 1975)。
Kraitchik (1942) 給出了構造 偶數 和 奇數 階數 幻方的通用技術。對於 奇數 ,可以使用一種非常直接的技術,稱為暹羅方法,如上圖所示(Kraitchik 1942, pp. 148-149)。它首先將 1 放在頂行的中心方格中,然後以遞增的方式將後續數字放在上方和右側一個單元格的方格中。計數是環繞的,因此從頂部掉下來會回到底部,從右側掉下來會回到左側。當遇到一個已填充的方格時,下一個數字將改為放置在前一個數字的下方 ,並且該方法像以前一樣繼續。該方法也稱為 de la Loubere 方法,據稱是在 de la Loubere 擔任暹羅大使返回法國後首次在西方報道的。
此方法的一種推廣使用“普通向量” ,它給出了每次非衝突移動的偏移量,以及“中斷向量” ,它給出了發生衝突時引入的偏移量。因此,標準暹羅方法的普通向量為 (1, ,中斷向量為 (0, 1)。為了使其產生幻方,每次中斷移動都必須在未填充的單元格上結束。可以透過考慮絕對和 、 、 和 來構造特殊的幻方類。將這些數字的集合稱為 sumdiffs(和與差)。如果所有 sumdiffs 都與 互質 ,並且該方陣是幻方,則該方陣也是泛幻方 。該理論起源於 de la Hire。下表給出了普通向量和中斷向量的特定選擇的 sumdiffs。
普通向量 中斷向量 sumdiffs 幻方 泛幻方 (1, ) (0, 1) (1, 3) 無 (1, ) (0, 2) (0, 2) 無 (2, 1) (1,
) (1, 2, 3, 4) 無 (2, 1) (1,
) (0, 1, 2, 3) (2, 1) (1, 0) (0,
1, 2) 無 (2,
1) (1, 2) (0, 1, 2, 3) 無
J. H. Conway 討論了另一種生成奇數 階幻方的方法,名為“菱形”方法。如上圖所示,在此方法中,奇數 沿方陣中央部分的菱形 形狀的對角線構建。然後,將錯過的偶數 沿透過環繞方陣獲得的對角線的延續線順序新增,直到環繞的對角線到達其初始點。在上面的方陣中,第一條對角線因此填充了 1、3、5、2、4,第二條對角線填充了 7、9、6、8、10,依此類推。
構造 階雙偶數 幻方的一種優雅方法是繪製穿過每個 s 子方陣,並按順序填充所有方格。然後用 替換劃掉的對角線上的每個條目 ,或者等效地,反轉劃掉條目的順序。因此,在上面 的示例中,劃掉的數字最初是 1、4、...、61、64,因此條目 1 被替換為 64,4 被替換為 61,依此類推。
J. H. Conway 提出了一種非常優雅的方法,用於構造 階單偶數 幻方,其中 (不存在 2 階幻方),他稱之為“LUX”方法。建立一個由 行 L、1 行 U 和 行 s 組成的陣列,所有行的長度均為 。將中間的 U 與其上方的 L 互換。現在,使用以字母陣列為中心的暹羅方法(從頂行中心方格開始)生成 階幻方,但根據字母規定的順序,順序填充圍繞字母的每組四個方格。該順序在上圖的左側進行了說明,完成的方陣在上圖的右側進行了說明。字母 L、U 和 X 的“形狀”自然地暗示了填充順序,因此該演算法得名。
還可以使用字母(在定義方陣時或作為其中的條目)構造幻方的變體,例如字母幻方 和聖殿騎士幻方 。
各種命理學性質也與幻方相關聯。Pivari 將上面說明的方陣分別與土星、木星、火星、太陽、金星、水星和月球聯絡起來。透過連線每個方陣中的連續數字(太陽幻方除外)可以獲得吸引人的圖案。
另請參閱 加法-乘法幻方 、
字母幻方 、
反幻方 、
結合幻方 、
雙重幻方 、
邊框方陣 、
丟勒幻方 、
尤拉方陣 、
富蘭克林幻方 、
日晷幻方 、
異幻方 、
拉丁方陣 、
幻圓 、
幻和 、
幻立方 、
幻六邊形 、
幻標記 、
幻序列 、
幻超立方體 、
幻方巡遊 、
多重幻方 、
乘法幻方 、
泛幻方 、
半幻方 、
護身符方陣 、
聖殿騎士幻方 、
三重幻方 在 課堂中探索此主題
在 中探索
參考文獻 Abe, G. "Unsolved Problems on Magic Squares." Disc. Math. 127 , 3-13, 1994. Alejandre, S. "Suzanne Alejandre's Magic Squares." http://mathforum.org/alejandre/magic.square.html . Andrews, W. S. Magic Squares and Cubes, 2nd rev. ed. New York: Dover, 1960. Andrews, W. S. and Sayles, H. A. "Magic Squares Made with Prime Numbers to have the Lowest Possible Summations." Monist 23 , 623-630, 1913. Ball, W. W. R. and Coxeter, H. S. M. "Magic Squares." Ch. 7 in Mathematical Recreations and Essays, 13th ed. New York: Dover, 1987. Barnard, F. A. P. "Theory of Magic Squares and Cubes." Memoirs Natl. Acad. Sci. 4 , 209-270, 1888. Benson, W. H. and Jacoby, O. Magic Cubes: New Recreations. New York: Dover, 1981. Benson, W. H. and Jacoby, O. New Recreations with Magic Squares. New York: Dover, 1976. Berlekamp, E. R.; Conway, J. H; and Guy, R. K. Winning Ways for Your Mathematical Plays, Vol. 2: Games in Particular. London: Academic Press, 1982. Chabert, J.-L. (Ed.). "Magic Squares." Ch. 2 in A History of Algorithms: From the Pebble to the Microchip. New York: Springer-Verlag, pp. 49-81, 1999. Danielsson, H. "Magic Squares." http://www.magic-squares.de/magic.html . Flannery, S. and Flannery, D. In Code: A Mathematical Journey. London: Profile Books, pp. 16-24, 2000. Frénicle de Bessy, B. "Des quarrez ou tables magiques. Avec table generale des quarrez magiques de quatre de costé." In Divers Ouvrages de Mathématique et de Physique, par Messieurs de l'Académie Royale des Sciences (Ed. P. de la Hire). Paris: De l'imprimerie Royale par Jean Anisson, pp. 423-507, 1693. Reprinted as Mem. de l'Acad. Roy. des Sciences 5 (pour 1666-1699), 209-354, 1729. Fults, J. L. Magic Squares. Chicago, IL: Open Court, 1974. Gardner, M. "Magic Squares." Ch. 12 in The Second Scientific American Book of Mathematical Puzzles & Diversions: A New Selection. New York: Simon and Schuster, pp. 130-140, 1961. Gardner, M. "Magic Squares and Cubes." Ch. 17 in Time Travel and Other Mathematical Bewilderments. New York: W. H. Freeman, pp. 213-225, 1988. Grogono, A. W. "Magic Squares by Grog." http://www.grogono.com/magic/ . Hawley, D. "Magic Squares." http://www.nrich.maths.org.uk/mathsf/journalf/aug98/art1/ . Heinz, H. "Downloads." http://www.magic-squares.net/downloads.htm . Heinz, H. "Magic Squares." http://www.magic-squares.net/magicsquare.htm . Heinz, H. and Hendricks, J. R. Magic Square Lexicon: Illustrated. Self-published, 2001. http://www.magic-squares.net/BookSale.htm . Hirayama, A. and Abe, G. Researches in Magic Squares. Osaka, Japan: Osaka Kyoikutosho, 1983. Horner, J. "On the Algebra of Magic Squares, I., II., and III." Quart. J. Pure Appl. Math. 11 , 57-65, 123-131, and 213-224, 1871. Hunter, J. A. H. and Madachy, J. S. "Mystic Arrays." Ch. 3 in Mathematical Diversions. New York: Dover, pp. 23-34, 1975. Kanada, Y. "Magic Square Page." http://www.kanadas.com/puzzles/magic-square.html . Kraitchik, M. "Magic Squares." Ch. 7 in Mathematical Recreations. New York: Norton, pp. 142-192, 1942. Lei, A. "Magic Square, Cube, Hypercube." http://www.cs.ust.hk/~philipl/magic/ Madachy, J. S. "Magic and Antimagic Squares." Ch. 4 in Madachy's Mathematical Recreations. New York: Dover, pp. 85-113, 1979. MathPages. "Solving Magic Squares." http://www.mathpages.com/home/kmath295.htm . Moran, J. The Wonders of Magic Squares. New York: Vintage, 1982. Pappas, T. "Magic Squares," "The 'Special' Magic Square," "The Pyramid Method for Making Magic Squares," "Ancient Tibetan Magic Square," "Magic 'Line.'," and "A Chinese Magic Square." The Joy of Mathematics. San Carlos, CA: Wide World Publ./Tetra, pp. 82-87, 112, 133, 169, and 179, 1989. Peterson, I. "Ivar Peterson's MathLand: More than Magic Squares." http://www.maa.org/mathland/mathland_10_14.html . Pickover, C. A. The Zen of Magic Squares, Circles, and Stars: An Exhibition of Surprising Structures Across Dimensions. Princeton, NJ: Princeton University Press, 2002. Pinn, K. and Wieczerkowski, C. "Number of Magic Squares from Parallel Tempering Monte Carlo." Int. J. Mod. Phys. C 9 , 541-547, 1998. http://arxiv.org/abs/cond-mat/9804109 . Pivari, F. "Nice Examples." http://www.geocities.com/CapeCanaveral/Lab/3469/examples.html . Pivari, F. "Create Your Magic Square." http://www.pivari.com/squaremaker.html . Sloane, N. J. A. Sequence A006052 /M5482 in "The On-Line Encyclopedia of Integer Sequences." Suzuki, M. "Magic Squares." http://mathforum.org/te/exchange/hosted/suzuki/MagicSquare.html . Weisstein, E. W. "Books about Magic Squares." http://www.ericweisstein.com/encyclopedias/books/MagicSquares.html . Wells, D. The Penguin Dictionary of Curious and Interesting Numbers. Middlesex, England: Penguin Books, p. 75, 1986. 在 上被引用 幻方
請引用為
Weisstein, Eric W. “幻方。” 來自 Web 資源。 https://mathworld.tw/MagicSquare.html
主題分類