Last updated May 20, 2008.
The main focus of this site is the set of 8 by 8 by 8 magic cubes that are often called perfect magic cubes of order-8, Nasik magic cubes of order-8, or order-8 pan-2,3-agonal magic cubes. The primary focus will be on a subset of these cubes that can be easily manipulated using binary math. There are 3,295,497,267,707,904,000 (3.3 quintillion) visually different magic cubes described in this subset. All cubes in the set have over 10,000 different ways to sum to the magic constant.
There are cubes of other orders that are considered perfect by various definitions. They will not be discussed here as they cannot be manipulated using the binary math that is the basis for the cubes on this site.
The perfect magic figures described herein are just manifestations of the larger set of n-dimensional perfect magic figures with sides of length 2 to the nth power. The basic properties of these figures can be described by an examination of the set of 4 by 4 pan-magic squares, the smallest recognized member of the set of n dimensional perfect magic figures. The principles of the square creation can then be extended to make larger magic squares, magic cubes, magic tesseracts and higher dimensional figures with similar magic properties.
The concepts behind the cubes are actually quite simple. An attempt will be made to describe the construction and characteristics of the cubes in terms that are understandable to anyone with minimal mathematical background. It is suggested that one read through the Basic Construction Concepts and Magic Cube Concepts before attempting to use one of the generators as they give background on how and why they work. The guides for each generator should also be perused as use of some functions is not intuitively obvious.
There are numerous sites that provide background information about magic squares, cubes, tesseracts, etc. Although this site will use some of the definitions and conventions from these other sites, some concepts will be described differently. An attempt will be made to provide explanations for any terms used. Better descriptions will often be provided at the other sites. Some definitions of terms as I use them on these pages are shown in Definitions.
There are five major sections on this site, each with several subparts. The first three sections progress from the simple order-4 pan-magic square to multidimensional hypercubes. The last two discuss obvious extensions to the main focus.
The overview section and its subparts gives some general information and background for the site. A detailed approach to making the magic figures is given below and within the Basic Concepts subpart. The focus of these parts is to describe the processes used to create the larger figures using the most basic magic figure in the set, the order-4 pan-magic square. Concepts are often reiterated in other sections but with less detail.
The Magic Cube section is the core of this site. Most of the focus for this site was built around the desire to understand the properties of the set of magic cubes that I first discovered in the 70's. All other parts of the site are offshoots of this effort.
A method to generate the order-8 cubes is described on the main page. A downloadable program, the cube generator, can quickly generate any of the perfect magic cubes in the subset. Once created any cube can be manipulated further by rotations, reflections, translations, and other changes to make additional perfect magic cubes with the same properties. Creation and manipulation of the cube is described in the Cube Generator Guide sub-part in a way to demonstrate the simple underlying principles.
The Base Cube Rules sub-part is meant to show the often complex interactions of groups of base cubes. Only about 1% of the possible combinations of 9 base cubes will be a valid magic cube. Some reasons for the failures are discussed.
The Magic Constant Groups sub-part describes two and three dimensional patterns of eight numbers that always add to the magic constant regardless of where the pattern is located within the cube. There are many such patterns but all can be easily described.
The Magic Hypercubes section is an obvious extension of the order-4 pan-magic squares and order-8 pan-2,3-agonal magic cubes to 4-, 5-, and multi-dimensional figures. The main page describe the difficulties inherent in manipulating these large figures. This can also be seen in the Statistics page.
The set of 16 by 16 by 16 by 16 perfect magic tesseracts or order-16 pan-2,3,4-agonal magic tesseracts can be made and manipulated using the tesseract generator. Creation and manipulation of this program are described in the Tesseract Guide sub-part. There are ~1.8E63 unique tesseracts in this set with over ten million ways to sum to the magic constant.
There is also a 5-D hypercube generator that can make perfect order-32 5-D hypercubes or order-32 pan-2,3,4,5-agonal magic 5-D hypercubes. Building this hypercube is difficult even with the help of the description in the 5-D Hypercube sub-part.
Finally a method for making n-dimensional perfect hypercubes is described in the n-Dimensions sub-part. It is possible to give the parameters for making such figures without testing for validity because when built according to the rules provided the resulting figure will always be a perfect magic figure.
The Upsized Figures section is an obvious extension of the concepts discussed on this site to order- mn pan-magic squares, pan-2,3-agonal cubes, pan-2,3,4-agonal tesseracts, etc. where m>=2 and n>=number of dimension of the figure.
The Other Perfect Cubes discusses all of the order-8 perfect magic cubes that can be made. Those that are described in the Magic Cube section constitute only a small portion of those that can be made. The section groups these other perfect magic cubes and attempts a description of the types but in the final analysis they are all fundamentally the same.
| 1 | 15 | 6 | 12 |
| 8 | 10 | 3 | 13 |
| 11 | 5 | 16 | 2 |
| 14 | 4 | 9 | 7 |
A magic cube is the three dimensional counterpart of magic squares which have been known for millennia. Normally a magic square is a set of consecutive numbers arranged in a square pattern such that every row, column and diagonal adds to the same number, its magic constant. Pan-magic squares, a 4 by 4 example of which is shown, have additional properties. For pan-magic squares, in addition to the rows, columns, and diagonals, all broken diagonals also add to the magic constant (34 for this square). The four number sets 8, 15, 9, 2 and 15, 3, 2, 14 are two examples of broken diagonals in the square above. An alternate way of describing this property is to wrap around a row or column to the opposite side of the square creating a new square. The diagonals of the new square will have been broken diagonals in the old and vice versa. If the left column in the square above is moved to the right side the new square will have 15, 3, 2, and 14 as an unbroken diagonal and all rows, columns, and diagonals will still add to the magic constant.
The order-4 pan-magic squares have additional combinations that add to 34. These combinations are not always mentioned in general discussions of pan-magic squares, as they are not requirements for the class. Some are only applicable to the 4k by 4k squares. All the 2 by 2 squares within the larger square, the corners of the magic square, and the corners of each 3 by 3 square add to the magic constant. The magic constant is also obtained by adding two consecutive numbers in one column or row to the two numbers that are the continuation of that column or row shifted by two. Two examples are 1, 8, 16, 9 and 14, 10, 3, 7. There are a total of 52 easily described ways that these magic squares add to 34. The other 34 possible number combinations that add to 34, do not form easily described patterns in the square and those patterns do not translate throughout the square to give other groups that add to the magic constant.
The magic cube counterpart of the 4 by 4 pan-magic squares is an 8 by 8 by 8 matrix of 512 consecutive numbers. For the numbers 1 to 512 each row, column, and pillar must add to 2052. Also the diagonals and broken diagonals of every 8 by 8 square and the four 3-D diagonals and all broken diagonals of the cube must add to the magic constant. The above properties are the requirements for the subset of magic cubes that are often called perfect magic cubes, but are more precisely called order-8 pan-2,3-agonal magic cubes. In this name pan indicates the property of moving a face from one side of the cube to the other whereas for a square it was a column or row. The 2,3-agonal indicates the 2 and 3-dimensional diagonals of the cube. Order-8 means it is an 8 by 8 by 8 cube.
As a bonus, the cubes described here have every 2 by 2 by 2 cube, the corners of the cube, and the corners of every 3 by 3 by 3, 4 by 4 by 4, 5 by 5 by 5, 6 by 6 by 6, and 7 by 7 by 7 cube add to 2052. Also the corners of many rectangular prisms, shifted rows, shifted columns, shifted pillars, shifted diagonals, and other patterns add to the magic constant. There are many easily described patterns within the cube that always add to 2052. Finally the addition properties for these cubes are maintained when faces of the cube are wrapped around to the opposite side in any order.
The first cube of this type has been attributed to Barnard1. It has often been attributed to Frankenstein, but Frankenstein's cube does not include broken diagonals and thus is not perfect by the current definition. Another example was described by Planck2 in 1905. The next published example of this type of cube, submitted by Dwane H. Campbell, was described in the puzzle section of the 1979 issue of The Old Farmers Almanac. The solution to the puzzle in that issue is available through Yankee, Inc. This latter cube may be the first example of the subset described here. Barnard's and Planck's cubes cannot be constructed using the procedure outlined in this discussion although most other characteristics are the same. The first two cubes and their history can be found on Heinz's site.
There have been other perfect order-8 magic cubes published subsequent to 1979. Benson and Jacoby5 published a cube in 1982 that is the same as Planck's except that the numbers were translated using the wrap around property of the cube so that the 1 appears in the lower left corner of the front square of the cube. By most definitions this would not be considered a different cube. It is only visually different. Hendricks'3 cube appears to have been constructed by a process that is similar to Barnard's cube and thus distinct from the focus subset described herein. Nakamura also has an algorithm to generate a cube of this type on his site. Abe's4 cube is part of the subset described here. The publication date given on Nakamura's site is 1983, but Abe's notes suggest it was first constructed in 1949. Can anyone confirm this date? See the references for further reading.
Hendricks3 also describes the first published perfect tesseract and perfect 5-D hypercube. These also are made differently than those described here. It is not possible to make them using the downloadable tesseract and hypercube generators.