What are magic hypercubes?


What are magic hypercubes?
The term magic hypercube is a mathematical concept. To explain this concept effectively, the hypercube part of this concept will be elaborated on first. A hypercube is the name for the group of objects such as:
In the picture above a so-called magic square is depicted. This square receives the term magic due to the fact that the addition of the numbers within each row and column and diagonal equals the same number. So in the image above take the first row for instance. adding the numbers within that row, which are 2,7 and 6 lead to the equation: 2+7+6 = 15. When taking another row, such as the second row, which contains the numbers 9,5 and 1, and adding those numbers together gives the equation: 9+5+1 = 15. Performing the same addition of the numbers within the 3rd row or within the columns or within the diagonals of the square will result in the same result if the cube is magic, which in this case it is. Each different dimension of magic hypercubes brings with it its own set of rules, but the general rule is that some kind of addition pattern within the hypercube leads to the same numerical result for each of its predefined set of numbers. Some of the other types of magical hypercubes are explained further and more in depth within their own respective section.

The first ever magic square created is called the Lo Shu (image above). It is also the face for all magic hypercubes. Most people in the world have seen it and know what it is. It is the classic 3 by 3 (this is also known as ‘an order 3’) magic square with diagonals, columns and rows all adding up to 15. This number 15 is also known as the magic constant of an order 3 magic square. With each different order and dimension (square (2nd), cube (3rd), etc) there is a different magic constant.

Magic constant
Every magic constant of magic hypercubes filled with consecutive numbers can in return be calculated with one single formula $$M_p(n) = \frac{n*(n^p+1)}{2}$$. M is the magic constant, n is the order of the magic hypercube and p is the dimension of the magic hypercube. This formula only works for magic hypercube shapes (squares, cubes, etc), however it will not work for every type of magic hypercube (specifically for this paper, different types of magic squares, which are discussed later on). The simple proof for this formula is the following. In a magic hypercube there are n rows with n being the order of magic hypercube. Therefore, one row is $$\frac{1}{n^{p-1}}$$ part of all values in the magic hypercube. This is because each number can be found in a row in the whole magic hypercube, therefore, the sum of all rows is the sum of all entries in the magic hypercube. Since there are n rows (because an order is rows*columns*etc, the order is also the length of the rows), 1 row makes up for $$\frac{1}{n^{p-1}}$$ of all entries in the magic hypercube and equates to the value of the magic constant. The sum of all the values inside a magic hypercubes is 1+2+...+$$n^p$$. This is because $$n^p$$ is the length of the magic hypercube to the power of the amount of times this length appears in different forms (squares, cubes, tesseract, etc). This sum for all values can be rewritten as $$n^p* \frac{(n^p+1)}{2}$$. This equation will give a value for the sum of the magic constant for every row and column. Therefore, to get to the magic constant for one row, the formula gets multiplied by $$\frac{1}{n^{p-1}}$$. This will result in the following equation that will give the exact magic constant for any order and dimension magic hypercube. $$\frac{1}{n^{p-1}}*n^p*\frac{(n^p+1)}{2}=n*\frac{(n^p+1)}{2}$$. Another way to find the formula for the magic constant of a magic hypercube is the following. $$M_p(n)=\frac{1}{n^{p-1}}\sum_{k=1}^{n^p}k = n*\frac{(n^p+1)}{2}$$. The function of $$\frac{1}{n^{p-1}}$$ in the summation is to reduce the sum of the full magic square to a single row or column. The function for k=1 is the lower limit of the summation. The function of $$n^p$$ is the upper limit of the summation. The function for k is the value that changes every time (k=1, k=2,...,k=$$n^p$$).

What suffices as a magic square?
When thinking about magic squares, many people will first think of the classic magic square. This magic square is known to have its rows, columns and diagonals equal to the same number (the magic constant). However, magic squares are not limited to only this type. There are many more different forms a magic square can have and there is possibility for even more to be discovered. Some of the more well known ones are known as the magic cube, magic tesseract and panmagic square, however there are many more. These links will take you to a section which will discuss a variety of different magic squares and magic shapes.

Orders
Magic squares can come in different sizes. For instance, 3*3 or a 4*4 magic squares. These sizes can be defined as orders, therefore, an order 3 magic square would be and 3 by 3 magic square and an order 4 a 4 by 4. We can say that a magic square has an order of n. To construct magic squares there are different groups of orders which pair with different ways to complete the magic squares. For this specific paper, there will be a look at the 4 different order groups. These order groups will all be for pandiagonal magic squares, as these solutions for different orders of magic squares were used in the website. The different order groups are: