This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
fuss:puzzles [2014/01/15 20:02] – external edit 127.0.0.1 | fuss:puzzles [2022/04/19 08:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Magic Square Generation ===== | + | ====== Magic Square Generation |
A magic square is an arrangement of numbers in a square grid, where the numbers in each row, column, and the numbers on the big diagonals, all add up to the same number. We can determine that number. Suppose $M$ is the number that each row, column or big diagonal must add up to. Since there are $n$ rows, the sum of all the numbers in the magic square must be $n*M$. Now, the numbers being added give the series $1, | A magic square is an arrangement of numbers in a square grid, where the numbers in each row, column, and the numbers on the big diagonals, all add up to the same number. We can determine that number. Suppose $M$ is the number that each row, column or big diagonal must add up to. Since there are $n$ rows, the sum of all the numbers in the magic square must be $n*M$. Now, the numbers being added give the series $1, | ||
Line 27: | Line 27: | ||
Thus, for a $3 \times 3$ magic square, M=$15$, for a $4 \times 4$ magic square $M=34$, for a $5 \times 5$ magic square $M=65$, etc... | Thus, for a $3 \times 3$ magic square, M=$15$, for a $4 \times 4$ magic square $M=34$, for a $5 \times 5$ magic square $M=65$, etc... | ||
- | ==== de la Loubère' | + | ===== de la Loubère' |
- Start in the middle column and place the number $x=1$. | - Start in the middle column and place the number $x=1$. | ||
Line 35: | Line 35: | ||
- Repeat at '' | - Repeat at '' | ||
- | {{wiki:puzzles_magicsquareupright.gif}} | + | {{puzzles_magicsquareupright.gif}} |
- | === Generalizing Loubère Algorithm === | + | ==== Generalizing Loubère Algorithm |
The same concept applies, for all $90^\circ$ counter-clockwise rotations of the movement direction, going back each time a square is occupied. | The same concept applies, for all $90^\circ$ counter-clockwise rotations of the movement direction, going back each time a square is occupied. | ||
- | {{wiki:puzzles_generalizedloubere.png}} | + | {{puzzles_generalizedloubere.png}} |
Every movement sequence will yield a magic square, all the columns, lines and big diagonals adding up to $15$. The squares generated by all four sequences are: | Every movement sequence will yield a magic square, all the columns, lines and big diagonals adding up to $15$. The squares generated by all four sequences are: | ||
Line 79: | Line 79: | ||
The same applies to any odd square (with a central tile), although not all movements will necessarily build a magic square. | The same applies to any odd square (with a central tile), although not all movements will necessarily build a magic square. | ||
- | {{wiki:puzzles_loubereodd.png}} | + | {{puzzles_loubereodd.png}} |
In this case, two of the paths do not generate magic squares. All the rest though do generate magic squares. The results in a $5 \times 5$ case are the following squares: | In this case, two of the paths do not generate magic squares. All the rest though do generate magic squares. The results in a $5 \times 5$ case are the following squares: |
For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.