noun
square formation (of troops)
Military term for troops arranged in a square, often for defense.
敵の騎兵を防ぐため、兵士たちは方陣を組んだ。
To defend against the enemy cavalry, the soldiers formed a square formation.
魔方陣は、縦横斜めの数の和がすべて等しくなるように数字を配置したものです。
A magic square is an arrangement of numbers where the sums of each row, column, and diagonal are all equal.
魔方陣 explicitly means 'magic square', while 方陣 alone can also refer to a military square formation.
Compound of 方 (ほう, 'square') and 陣 (じん, 'formation, camp'). The mathematical sense is a calque from English 'magic square'.