The 4x4 magic squares are small and easily manipulated. The total number of simple 4x4 magic squares that use just the numbers from 1 to 16 can be easily determined with modern computers as there are only 16! possible combinations to evaluate. The 4x4 pan-magic squares are a small but important subset of the set of 4x4 magic squares. They are the smallest size square that can be called nasik by the modern definition. A 3x3 square cannot be nasik.

It has been determined that the smallest possible nasik magic cube is an 8x8x8 magic cube. As far as I know no one is capable of evaluating all 512! or 3.48 E+1146 possible combinations of the numbers from 1 to 512 in a cube of even this small size. The number of simple order-8 magic cubes is therefore not known. The 3.3 E+18 nasik magic cubes derived using the base line approach are only a small fraction of the possible order-8 magic cubes. It is even a small fraction of the possible order-8 nasik magic cubes. Many order-8 nasik magic cubes cannot be made using the cube generator. These are described in more detail in Other Nasik Cubes

The smallest nasik magic figures of any dimension, n, have been found to be of order-2n. As n gets larger, the size of these figures increases dramatically. They go from the easily manageable 4x4 square to the unimaginably large in only a few steps. The magnitude of the change is illustrated below.

In order for an n-dimensional magic figure to be considered a nasik magic figure, it must meet certain requirements. All lines through the figure parallel to one of the axes must add to the same number, the magic constant. All diagonals and all broken diagonals of the figure must also add to the magic constant. By all diagonals is meant the diagonals and broken diagonals of all 2-D squares, 3-D cubes, 4-D tesseracts, up to n-D figures that are within the n-dimensional figure.


The principles described can be applied to figures of any dimension n, provided the sides of the figures are 2n long. The sides of the figure define the base line length. There are 2(n2) numbers in these figures. This number also is the number of possible positional translations of the numbers within the figure. For various parameters, the table below illustrates the magnitude of the change encountered in going from the square, to the cube, to the tesseract, etc. The values shown are only for the smallest member of each type, i.e. n-dimensional figures of order-2n It should be noted that extrapolation of the table suggests a one dimensional magic line and perhaps even a magic point, both of which are trivial.

Statistics for Magic Figures of n-Dimensions and Order-2n Made Using Base Lines
dimensions 1 2 3 4 5 6 7 8 n
base line lengths 2 4 8 16 32 64 128 256 2n
numbers in figure 2 16 512 65536 33554432 6.87E+10 5.63E+14 1.84E+19 2(n2)
dimensional arrangements 1 2 6 24 120 720 5040 40320 n!
possible base line reversals 2 4 8 16 32 64 128 256 2n
aspects 2 8 48 384 3840 46080 645120 10321920 n!*(2n)
base line of type A 1 1 1 1 1 1 1 1 20
base line of type B 2 2 2 2 2 2 2 21
base line of type C 8 8 8 8 8 8 23
base line of type D 128 128 128 128 128 27
base line of type E 32768 32768 32768 32768 215
base line of type F 2.15E+9 2.15E+9 2.15E+9 231
base line of type G 9.22E+18 9.22E+18 263
base line of type H 1.70E+38 2127
base line of type N 2(2(n-1)-1)
total base line combinations 1 2 16 2048 67108864 1.44E+17 1.33E+36 2.26E+74 A*B*C*...N
possible n-D base figures 1 4 96 49152 8.05E+9 1.04E+20 6.70E+39 9.12E+78 n!*A*B*C*...N
base n-D figures needed 1 4 9 16 25 36 49 64 n2
potential n-D magic figures 1 256 6.93E+17 1.16E+75 4.46E+247 3.78E+720 2.99E+1951 2.73E+5053 possibleneeded
counted n-D magic figures 1 24 6.44.E+15 ~5.80E+65 ? ? ? ? ?
distinct n-D magic figures 1 3 1.34E+14 ~1.51E+63 ? ? ? ? counted/aspects
unique n-D magic figures 1 1 1.77E+10 ~2.77E+52 ? ? ? ? counted/n2!

In the figures, the dimension may be shuffled in any order to give n! dimensional arrangements. The direction of the base lines can be reversed for any dimension or any combination of dimensions. There are 2n possible line reversal combinations. Combining these two figure manipulations gives all the possible aspects of the figure. There are thus n!*(2n) different aspects. The aspects just describe different orientations of the same figure.

In this discussion, the base lines are usually described by an alphanumeric code. The alpha part is just a single letter in alphabetic order. There is just one A code, 2 B codes, 8 C codes, etc. If n is equal to the Nth letter then the Nth letter will have 2(2n-1-1) different base lines. To make a base n-D figure, n base lines must be combined. One base line from each of the first N alpha types. The total number of total n-D base line combinations with a given fixed order of the alpha's will be equal to the product of the number of different base lines of the first n alpha's. For example for a five dimensional figure there will be 1x2x8x128x32768=67108864 total 5-D base line combinations with codes in the order A, B, C, D, and E in the first, second, third, fourth, and fifth dimensions respectively. There are, however, 5! (n! for the general case) different ways the letters can be arranged in the dimensions. Therefore, there are 120x67108864=8.05E+9 possible 5-D base figures.

Only 25 (n2 for the general case) base 5-D figures are needed to complete a 5-D magic figure. However, there are 8.05E+9 possible base 5-D figures. This means that there are (8.05E+9)25 or 4.46E+247 potential magic 5-D figures. The actual number of 5-D magic figures that can be made using base lines cannot easily be determined. For the square, however, there are only 24 out of a possible 256, 44, or 9.375%. Only 24 of the 256 possible base squares combinations are composed of four different base squares the remainder contain one or more duplicate base square. These 24 are all pan-magic squares. Each of the 3 distinct magic squares can be shown in 8 different aspects, thus accounting for all 24 of the counted order-4 magic squares that are pan-magic. Based on my definition of a unique magic cube in Magic Cube Guide there is only one unique pan-magic square of order-4. This is because all of the pan-magic squares use the same four base squares.

For higher dimensional figures, potential magic figures with duplicate base figures account for a minor percentage of the possible combinations. For the magic cube, there are 969 or 6.93 E+17 possible magic cubes as calculated above. If duplicates are eliminated then there are 96x95x94x93x92x91x90x89x88 or 4.70E+17 possible magic cubes. There are 6.44.E+15 counted magic cubes. These account for only 0.929% or 1.370% of the possible magic cubes depending on which value is used for the number of possible magic cubes. I prefer to use 969, thus 0.929%. These were counted such that all 48 aspects of each different cube were included in the count. Therefore, there are 1.34E+14 distinct magic cubes. As described under Unique Cube Conformation in Magic Cube Guide there are 1.77E+10 unique magic cubes. To be unique, at least one of the nine base cubes has to be different from any other unique cube. When Keith enumerated all of the possible magic cubes his algorithm actually only evaluated unique cubes. The resulting number was then multiplied by 9! to get the total.

There are 1.16E+75 possible magic tesseracts. In a test, only 33 out of 68,719,476,736, 236,tesseracts generated from randomly selected base tesseracts were nasik magic tesseracts. This is about 500 parts per trillion. There are therefore only about 5.80E+65 countable magic tesseracts that can be generated, but all 384 aspects of each different tesseract are in this value. There are thus ~1.51E+63 distinct magic tesseracts that can be made using base lines. It is possible to calculate the number of potential magic figures for orders higher than the tesseract, however, even estimating the number of actual magic figures will be extremely difficult. It might seem that a 500 ppt chance of obtaining a magic tesseract is miniscule but it is much better than the completely random chance of finding one in the 65536! possible combinations of the numbers from 1 to 65536 distributed in a 16x16x16x16 matrix.


The definition of a nasik magic figure is based on the number of ways it can add to the magic constant and on its ability to undergo all possible translations and retain its properties. The latter is not usually stated in the definition but is inherent in the way addition properties are defined. The n numbers placed somewhere in the figure must also be in consecutive order. For the pan-magic squares, there are four columns and four rows that add to the magic constant. These are the eight line examples listed under two dimensions in the table below. There are also two obvious diagonals that add to the magic constant. The other six 2-D diagonal examples are usually called broken diagonals. These diagonals leave the square before traversing four squares. They continue on the opposite side of the square in the same direction until four numbers are crossed. By translating rows and/or columns to the opposite side, the broken diagonals can become regular diagonals. Having all rows, columns, diagonals, and broken diagonals equal the magic constant is the traditional definition of pan-magic squares.

The cube has lines going in three directions corresponding to the directions of the three axes. There are 64 (23(3-1) or 2n(n-1) for the general case) rows, 64 columns, and 64 pillars in the 8x8x8 cube accounting for the 192 line examples. There are three types of plane directions in the cube, xy, xz, and yz. There are 8 squares in each direction and 8 diagonals in each square for 64 diagonals in one direction. Each square has two diagonal directions so there are 2x3x64=384 2-D diagonal examples for the cube. There are also four 3-D diagonals through the cube from each corner to the opposite corner. There are also broken 3-D diagonals parallel to each of the four cube 3-D diagonals making 64 3-D diagonals in each direction or 256 3-D diagonals examples altogether. A nasik magic cube has all of its rows, columns, pillars, 2-D diagonals, 3-D diagonals, and broken 2-D and 3-D diagonals equal the magic constant. As stated earlier this definition ensures that squares can be translated from one side of the cube to the opposite side in any order and any direction.

The rest of the table is filled out in a similar manner. The number of sums needed to determine the magic character increases rapidly as the dimensions increase. The number of square types, cube types, etc for any size figure can be determined using the somewhat ugly equations on the right under the n. The equation can be further generalized as n!/((n-m)!m!) where the m corresponds to the number of dimensions the diagonal crosses. The examples can be similarly generalized as 2(m-1)(n!/((n-m)!m!))2n(n-1) where 2(m-1) is the number of primary diagonals the corresponding figure has.

Magic Constant Occurrences in Nasik Figures of n-Dimensions and Order-2n
dimensions 1 2 3 4 5 6 7 8 n
line types 1 2 3 4 5 6 7 8 n
line examples 1 8 192 16384 5242880 6.44E+9 3.08E+13 5.76E+17 n(2n(n-1))
square types 1 3 6 10 15 21 28 n!/((n-2)!2!)
2-D diagonal examples 8 384 49152 2.10E+7 3.22E+10 1.85E+14 4.04E+18 2(n!/((n-2)!2!))2n(n-1)
cube types 1 4 10 20 35 56 n!/((n-3)!3!)
3-D diagonal examples 256 65536 4.19E+7 8.59E+10 6.16E+14 1.61E+19 4(n!/((n-3)!3!))2n(n-1)
tesseract types 1 5 15 35 70 n!/((n-4)!4!)
4-D diagonal examples 32768 4.19E+7 1.29E+11 1.23E+15 4.04E+19 8(n!/((n-4)!4!))2n(n-1)
5-D hypercube types 1 6 21 56 n!/((n-5)!5!)
5-D diagonal examples 1.68E+7 1.03E+11 1.48E+15 6.46E+19 16(n!/((n-5)!5!))2n(n-1)
6-D hypercube types 1 7 28 n!/((n-6)!6!)
6-D diagonal examples 3.44E+10 9.85E+14 6.46E+19 32(n!/((n-6)!6!))2n(n-1)
7-D hypercube types 1 8 n!/((n-7)!7!)
7-D diagonal examples 2.81E+14 3.69E+19 64(n!/((n-7)!7!))2n(n-1)
8-D hypercube types 1 n!/((n-8)!8!)
8-D diagonal examples 9.22E+18 128(n!/((n-8)!8!))2n(n-1)
translations 2 16 512 65536 3.36E+7 6.87E+10 5.63E+14 1.84E+19 2nn or 2(n2)

In general a nasik magic figure must have all lines in every direction, all diagonals in every possible dimension and all broken diagonals in all possible dimensions add to the magic constant for that figure. In other words, all the examples in the corresponding column of the Magic Constant Occurrences table above must add to the magic constant.

The number of possible translations in any of the figures is equal to the number of numbers in the figure. It is possible to translate any number to any position of the figure and still retain the magic properties of the figure. For any translation to occur all the numbers in the figure must move the same vector to new positions.