Magic square is an arrangement of distinct numbers usually integers, in a square grid, where the numbers in each row, and in each column all add up to the same number.
Magic squares have a long history, dating back to 650 BC in China. At various times they have acquired magical or mythical significance, and have appeared as symbols in works of art. According to the Chinese legend, there was at one time in ancient China a huge flood. While the great king Yu (禹) was trying to channel the water out to sea, a turtle emerged from it with a curious figure / pattern on its shell: a 3×3 grid in which circular dots of numbers were arranged, such that the sum of the numbers in each row, column and diagonal was the same: 15, which is also the number of days in each of the 24 cycles of the Chinese solar year. According to the legend, thereafter people were able to use this pattern in a certain way to control the river and protect themselves from floods.