This is an old revision of the document!
Table of Contents
小集合の定義
魔方陣全体の集合を小集合に分けるために、いくつかの用語を定義します。
魔方列とその2進数表現
- n次の魔方列 とは、[1..n2]の範囲のn個の異なる整数からなる集合で、要素の和がn次の魔方和( ( n2 + 1 ) * n ) / 2に等しいものです。
- 例:
- { 2, 9, 4 } は 3次の魔方列です。
- { 10, 7, 14, 3 } は 4次の魔方列です。
- 異なる正整数の集合{ a1, a2, a3 … }は値が 2a1-1 + 2a2-1 + 2a3-1 + … に等しい一つの整数で表現できます。これを整数集合の2進数表現と呼ぶことにします。
- 例:
- { 2, 9, 4 } は 1 0000 10012 = 0x10b と表現できます。
- { 10, 7, 14, 3 } は 0010 0010 0100 01002 = 0x2244 と表現できます。
異なる正整数集合の順序(大小関係)
- 異なる正整数集合の大小関係は、2進数表現の大小で定義することができます。
- 例:
- 魔方列 { 5, 16, 2, 11 } は魔法列 { 12, 1, 15, 6 } よりも大きいと定義されます。なぜなら、それらの2進数表現は1000 0100 0001 0010 ( = 0x8412 ) と 0100 1000 0010 0001 ( = 0x4821 )であり、0x8412 > 0x4821だからです。
魔方列の補列
魔方列の各要素 x をすべて n2 + 1 - x で置き換えてできる集合も魔方列になります。 このようにしてできる魔方列を元の魔法列の 補列(complement)と呼びます。
- 4次における例:
- { 12, 1, 15, 6 } は { 5, 16, 2, 11 } の補列です。
- { 7, 10, 3, 14 } は自分自身の補列です。
2進数表現においては、補列は 2進数の逆順(bit reversal)で得られます。
- 4次の例:
- 1000 0100 0001 0010 の補列は 0100 1000 0010 0001 です。
The representative magic series of a magic square
Every row and column of a magic square is always a magic series. We define the representative magic series of a magic square as the largest magic series which forms a row, a column, the complement of a row, or the complement of a column. Note that diagonal magic series are not considered a representative magic series.
Example: The representative magic series of a magic square
16 12 1 5 7 3 14 10 9 13 4 8 2 6 15 11
is { 16, 13, 3, 2 } = 0x9006, which forms the complement of the third column.
We classify magic squares by their representative magic series. This classification is invariant under rotations, reflections, M-transformations, and the complement transformation.
