Magic squares have been studied since
antiquity. The earliest recorded appearance dates back to BCE
2200 in China. Babylonian mathematicians used a
modification of magic squares in their arithmetical
calculations. In the ninth century CE Iranian and other Moslem
mathematicians used magic squares in astrology and for
calculations related to horoscopes. By the fourteenth century
magic squares were well-known to European scientists. A famous
engraving by the German artist Albrecht D¨urer includes a
magic square and is shown below.
There are well-known algorithms for
generating
n
× n
magic squares for
n = 4k
or an odd integer, but as far ass
this writer knows no general and efficient algorithm without
human intervention is known for n
= 4k
+ 2 . In this paper we present a
simple algorithm for generating magic squares for
n = 4k
+ 2. The algorithm was also
experimentally tested for integers
n < 10¹².
The exe-file for the algorithm is available in below.(ABS)
exe file of software for
generating magic square (4k+2)
[Download]