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だからです。
Complement of a magic series
If you replace each element x of a magic series by n2 + 1 - x , the result is also a magic series. We call the resulting set the complement of the original magic series.
- Examples in the case of order 4:
- { 12, 1, 15, 6 } is the complement of { 5, 16, 2, 11 }.
- { 7, 10, 3, 14 } is the complement of itself.
In binary representations, the complement of a magic series is obtained by the bit reverse manipulation.
- Example in the case of order 4:
- The complement of 1000 0100 0001 0010 is 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.
