# n-DIMENSIONAL MAGIC FIGURES

While trying to find a workable process to make the 5-dimensional magic figure, I found that using compatible groups improved the chances of making a valid magic hypercube. I also found that focusing primarily on one base line for each base line type was useful. I finally realized that the E base lines were the key. I built a 5-D counterpart of the 6-D hypercube shown below, and it worked. So do the tesseract, cube, and square counterparts. These are shown on the Structured worksheet of the HyperCubeLines Excel Spreadsheet available on the Downloads page. My statements below are derived from working with the 5-D hypercube and to some degree the tesseract and cube. I believe that all are applicable to n-dimensions and have a mathematical proof in Überprüfen. A discussion of the basic construction using the cube as an example is given below.

It is also possible to extend the base line concepts for prime numbers to any number of dimensions. I do not currently have a formal proof for this assertion but the extrapolation seems sound. By extrapolation it would appear that the n base lines x mod o, 2x mod o, 4x mod o, …, 2(n-1)x mod o with 0 ≤ x < o should give a valid n-dimensional base hypercube. The set of base lines are systematically rotated through all n dimensions to make n base hypercubes. The base hypercubes are then combined to make master base lines and/or the hypercube itself. The prime number chosen must be sufficiently large such that a nasik hypercube of the chosen number of dimensions is possible.

## ORDER-67 6-D HYPERCUBES

Master base lines for an order-67 6-D nasik hypercube are given in the 6-D 67 worksheet of the HyperCubeLines Excel Spreadsheet available on the Downloads page. The master base lines are derived as described below.

1. Let the six base lines of the 6-D hypercubes be: a = x mod 67, b = 2x mod 67, c = 4x mod 67, d = 8x mod 67, e = 16x mod 67, and f = 32x mod 67 for 0 ≤ x < 67.
2. For the first base 6-D hypercube let the row base line be a, the column b, the pillar c, the file d, the 5th-D e and the 6th-D f.
3. For the second base 6-D hypercube let the row base line be b, the column c, the pillar d, the file e, the 5th-D f and the 6th-D a.
4. For the third base 6-D hypercube let the row base line be c, the column d, the pillar e, the file f, the 5th-D a and the 6th-D b.
5. For the fourth base 6-D hypercube let the row base line be d, the column e, the pillar f, the file a, the 5th-D b and the 6th-D c.
6. For the fifth base 6-D hypercube let the row base line be e, the column f, the pillar a, the file b, the 5th-D c and the 6th-D d.
7. For the last base 6-D hypercube let the row base line be f, the column a, the pillar b, the file c, the 5th-D d and the 6th-D e.
8. The six base 6-D hypercubes are combined as 675(base 6-D hypercube 1) +674(base 6-D hypercube 2) + 673(base 6-D hypercube 3) + 672(base 6-D hypercube 4) + 67(base 6-D hypercube 5) + base 6-D hypercube 6 to make the master base lines.

The value at position nijklmo in the 6-D hypercube is: nijklmo = 675((row1i + column1j + pillar1k + file1l + 5th-D1m + 6th-D1o) mod 67) + 674((row2i + column2j + pillar2k + file2l + 5th-D2m + 6th-D2o) mod 67) + 673((row3i + column3j + pillar3k + file3l + 5th-D3m + 6th-D3o) mod 67) + 672((row4i + column4j + pillar4k + file4l + 5th-D4m + 6th-D4o) mod 67) + 67((row5i + column5j + pillar5k + file5l + 5th-D5m + 6th-D5o) mod 67) + ((row6i + column6j + pillar6k + file6l + 5th-D6m + 6th-D6o) mod 67).

## ORDER-64 6-D HYPERCUBES

The base lines for a nasik 6-D magic hypercube of order-64 are shown below in alphanumeric code. The multipliers for the base hypercubes are 2(36-base#). Relative to the immense number of possible hypercubes that can be made using base lines, it is a very simple construct. The number subscripts for the F base lines are written in base 16 as it is so much easier to do and the underlying 64-bit code pattern is much easier to derive. The F base line numbers actually represent just the first 32 bits of the base line. The other 32 bits are the inverse of the first 32. The F0x0 base line is thus 32 zero's followed by 32 one's. For anyone not familiar with the format used for the subscript, the initial 0x indicates that the number that follows is written in base sixteen. An alternate way of describing the 6-D magic hypercube is to use master base lines. Use of master base lines simplifies determination of a number at any position within the figure. This set of master base lines is also shown in the 6-D 64 worksheet of the HyperCubeLines Excel Spreadsheet available on the Downloads page.

The hypercube is nasik or pan-2,3,4,5,6-agonal. It is {6compact2,3,5,9,17,33}. This hypercube has special features in many of its lower dimensional magic figures. Let the rows, columns, pillars, files, 5th-D and 6th-D be the u, v, w, x, y, and z axes. All uvwxy 5-D figures are {5compact2,3,5,9}. All uvwxz 5-D figures are {5compact2,3,5}. All uvwyz 5-D figures are {5compact2,3,17}. All uvxyz 5-D figures are {5compact2,9,17}. All uwxyz 5-D figures are {5compact5,9,17}. All vwxyz 5-D figures are {5compact3,5,9,17}. All uvwx tesseracts are {4compact2,3,5}. All uvwy and uvwz tesseracts are {4compact2,3}. All uvxy tesseracts are {4compact2,9}. All uvxz tesseracts are {4compact2}. All uvyz tesseracts are {4compact2,17}. All uwxy tesseracts are {4compact5,9}. All uwxz tesseracts are {4compact5}. All uwyz tesseracts are {4compact17}. All uxyz and vxyz tesseracts are {4compact9,17}. All vwxy tesseracts are {4compact3,5,9}. All vwxz tesseracts are {4compact3,5}. All vwyz tesseracts are {4compact3,17}. All wxyz tesseracts are {4compact5,9,17}. All uvw cubes are {3compact2,3}. All uvx, uvy, and uvz cubes are {3compact2}. All uwx and wxz cubes are {3compact5}. All uxy and vxy cubes are {3compact9}. All uyz, vyz, and wyz cubes are {3compact17}. All vwx cubes are {3compact3,5}. All vwy and vwz cubes are {3compact3}. All wxy cubes are {3compact5,9}. All xyz cubes are {3compact9,17}. All uv squares are {2compact2}. All vw squares are {2compact3}. All wx squares are {2compact5}. All xy squares are {2compact9}. And all yz squares are {2compact17}.

## ALPHANUMERIC REPRESENTATION OF THE ORDER-64 6-D HYPERCUBE

The base lines of the order-64 hypercube described above are displayed below in alphanumeric format. Displayed in this manner it is easy to see the structured pattern that leads to the 6-D hypercube.

The combination of just the F base lines in the pattern below will produce all the numbers from 0 to (236-1). The resulting numbers, however, are not arranged correctly to make a magic hypercube. Addition of the A, B, C, D, and E base lines rearranges the numbers so that a valid magic hypercube is created. In other words, uniform integral distribution can be achieved using only the F base lines, but in order to make a valid nasik 6-D magic hypercube all six base line types must be present in each of the 36 base hypercubes. A combination of uniform integral distribution and valid base hypercubes will insure that the finished hypercube is valid.

 base # row column pillar file fifth sixth 1 A B0 C0 D0 E0 E0x0 2 A B0 C0 D0 E0 F0xffff 3 A B0 C0 D0 E0 F0xff00ff 4 A B0 C0 D0 E0 F0xf0f0f0f 5 A B0 C0 D0 E0 F0x33333333 6 A B0 C0 D0 E0 F0x55555555 7 A B0 C0 D0 F0x0 E0 8 A B0 C0 D0 F0xffff E0 9 A B0 C0 D0 F0xff00ff E0 10 A B0 C0 D0 F0xf0f0f0f E0 11 A B0 C0 D0 F0x33333333 E0 12 A B0 C0 D0 F0x55555555 E0 13 A B0 C0 F0x0 D0 E0 14 A B0 C0 F0xffff D0 E0 15 A B0 C0 F0xff00ff D0 E0 16 A B0 C0 F0xf0f0f0f D0 E0 17 A B0 C0 F0x33333333 D0 E0 18 A B0 C0 F0x55555555 D0 E0 19 A B0 F0x0 C0 D0 E0 20 A B0 F0xffff C0 D0 E0 21 A B0 F0xff00ff C0 D0 E0 22 A B0 F0xf0f0f0f C0 D0 E0 23 A B0 F0x33333333 C0 D0 E0 24 A B0 F0x55555555 C0 D0 E0 25 A F0x0 B0 C0 D0 E0 26 A F0xffff B0 C0 D0 E0 27 A F0xff00ff B0 C0 D0 E0 28 A F0xf0f0f0f B0 C0 D0 E0 29 A F0x33333333 B0 C0 D0 E0 30 A F0x55555555 B0 C0 D0 E0 31 F0x0 A B0 C0 D0 E0 32 F0xffff A B0 C0 D0 E0 33 F0xff00ff A B0 C0 D0 E0 34 F0xf0f0f0f A B0 C0 D0 E0 35 F0x33333333 A B0 C0 D0 E0 36 F0x55555555 A B0 C0 D0 E0

## VARIATIONS OF THE NASIK 6-D MAGIC HYPERCUBE

I would be remiss if I did not now provide the means to make numerous additional nasik 6-D magic hypercubes. There are generalizations that can be made to the basic structure that will generate many additional examples. Some are obvious and one at least to me is baffling.

### Reordering base hypercubes

There are 36 base hypercubes in the figure at right. These can be arranged in 36! different orders. Every order is a different valid pan-2,3,4,5,6-agonal magic cube of order-64.

### Alternate base lines

In the example the B, C, D, and E base lines all have subscripts of zero. The subscripts may be any of their possible values as long as each base line type is the same throughout the matrix, i.e. all E14729's. This means 2 B states, 8 C's, 128 D's, and 32768 E's or 67,108,864 possible combinations using the pattern at right.

### Modified code orders

In the example, the position of the A's, B's, C's, D's, and E's is alphabetical with the F base lines inserted in an ordered pattern. The order does not need to be alphabetical. Any order is OK as long as the pattern is maintained. There are 6!, 360, different orders possible. The above are obvious extensions of rules discussed elsewhere. Altogether they give 36!*67108864*120 different valid 6-D hypercubes based on the pattern at right.

### Other compatible F groups

In the figure at right, the same set of six F base lines is used in every dimension. There are many compatible groups of F base lines. The process used to determine compatible groups is discussed in the Compatible Base Line Rules section of Base Cube Rules. Any of these compatible groups can be used. Using a different compatible group in each of the dimensions also works. Using different compatible groups in combination with the other modifications discussed above gives a tremendous number of valid nasik 6-D magic hypercubes.

### Codes tied to F groups

The A, B, C, D, and E codes have been kept the same in the modifications discussed above. For any given set of 6 F codes (group of 6 F codes at the same dimensional position), they must be kept the same. For each set of F codes the order of the A, B, C, D, and E codes can be different and their number subscript can be different.

### Left and right sides of the pattern

There is an additional modification to the pattern above that appears to work. I say appears because I do not have an explanation of why it works. The manipulation has always worked with the 5-dimensional hypercube. That leads me to believe that the approach is general.

The sample hypercube can be viewed as having three parts, the F base lines, the base lines on the left of the F base lines, and the base lines on the right. Modification of the F base lines has already been discussed. If one of the other two parts is left as is, then the remaining part can be modified indiscriminately as long as the base hypercube requirements are met, i.e. there is one of each type of base line in the base hypercube. Base hypercube 31 could thus be F0, C3, B0, E2167, A, and D95. The other base lines to the right of the F base lines may be shuffled and reassigned other numbers without regard to any of the others on the right side. The base lines on the left, however, are severely restricted. With a given set of base lines on the right some changes on the left may be possible but making those changes then restricts additional changes on the right.

The ability to modify one side of the pattern as above results in a tremendous number of different hypercubes. However, many valid hypercubes ignore these restrictive rules. These other hypercubes are at this point beyond my reach.

## THE NASIK n-DIMENSIONAL MAGIC HYPERCUBES

From the example above it should be obvious how to make nasik magic hypercubes of any dimension. The matrix of base lines will have n columns and n2 rows. There must be a group of n compatible nth letter base lines in each column. There must be a base line of type A through the nth letter in each row. Each row will describe one of the n2 base hypercubes. The subscripts for the letters follow the rules outlined above.

The value of the number at any position can be determined by taking an exclusive OR of the intersection of all the master base lines in binary at that position. The bit code value of all numbers will be n2 bits long including leading zeros if necessary. If the intersection in a direction is at the ith bit then the n2-bit code value for that dimension is the binary equivalent of the ith number of the master base line going in that direction. In like manner, the n2-bit code value must be determined for all n dimensions. The exclusive OR combination of each of the n dimension's individual n2 bits is determined. The resulting n2 bit number is the number, in binary, at the position desired. This is the approach used by the 5-D Hypercube Generator's Magic Constant checker.

Looking at the first table in Statistics, one can see the immensity of the problem encountered in attempting to verify uniform integral distribution in hypercubes of 7 dimensions or larger. I am certain that the rules I have outlined above work but it is always nice to have independent verification and for these figures, that requires proof of uniform integral distribution. Without the proof below, independent verification of uniform integral distribution for even one hypercube of 6 dimensions would be difficult. It should be possible to verify a 6-dimensional hypercube, but it would take considerable time with my current resources. For now I leave independent verification of the higher dimensional hypercubes to others.

## PROOF THAT THE n-DIMENSIONAL HYPERCUBES ARE NASIK

Looking at the first table in Statistics, one can see the immensity of the problem encountered in attempting to verify uniform integral distribution in hypercubes of 6 dimensions or larger. I am certain that the rules I have outlined above work but it is always nice to have verification and verification for these figures requires proof of uniform integral distribution. Verifying uniform integral distribution for even one hypercube of 6 dimensions would be difficult with the methods used for the cube, tesseract, and 5-D hypercube. Fortunately, it can be proved mathematically. See Überprüfen for a complete mathematical proof. The proof below is an older more descriptive discussion. It uses the cube generator to provide examples. I continue to offer this proof as an alternate to the Überprüfen approach.

### Requirements

As stated in Magic Cube Basics there are two things that must verified in order to confirm that a magic figure has indeed been made. The figure must add to the magic constant in all the required ways and the figure must have uniform integral distribution, i.e. all integers from 0 to 2n2.

### Addition properties

A proof of the base cube addition properties was given in Magic Cube. That proof can be extended to base figures of all dimensions. The only requirement is that the base figure have in one of its directions an A code, a B code, ... , and an nth letter code. For the 6-D figure above, that means an A, B, C, D, E, and F code. All the base 6-D hypercubes above meet this requirement.

In Basic Construction the addition properties of base squares were discussed. The rules can be extended to n-dimensional figures as well. Thus, the addition of 235 times the first base 6-D hypercube plus 234 times the second base 6-D hypercube plus ... plus 20 times the last base 6-D hypercube gives a magic 6-D hypercube with all the appropriate additions.

Based on the above two paragraphs, the 6-D hypercube shown above in base line code has all of the appropriate additions of a nasik hypercube. That is all agonals and all diagonals, triagonals, 4-D agonals, 5-D agonals, and 6-D agonals and their broken counterparts add to the magic constant for that figure. However, this does not ensure uniform integral distribution.

### Uniform integral distribution, but not magic

 C5 0 1 0 1 1 0 1 0 C3x2 0 0 2 2 2 2 0 0 C0x4 0 0 0 0 4 4 4 4 sum 0 1 2 3 7 6 5 4 x8 0 8 16 24 56 48 40 32 x64 0 64 128 192 448 384 320 256

As I find it hard to think in 6-D much of this discussion will based on the cube. The cube generator will be used to illustrate the procedure and the observations extended to higher dimensions. Open the cube generator and under RESTART select BASE LINE ARRAY. In the first three pillar boxes select C0, C3, and C5. This is a compatible group as defined in Base Cube Rules. In the middle three column boxes and the last three row boxes enter the same three codes. This is the equivalent of entering just the F codes in the 6-D figure above. In the top row of the first square, observe the numbers 0, 1, 2, 3, 7, 6, 5, 4. This series is the sum of the C5 plus 2 times C3 plus 4 times C0 bits as shown at right. The row below that, is 8 more than the top row, the third row is 16 more, then 24, 56, 48, 40, and 32 more. The column series in the previous sentence, starting with zero, is 8 times the row series above. The second square is 64 more than the first, the next square is 128 more, then 192, 448, 384, 320, and 256 more. This pillar series is 64 times the row series and 8 times the column series. The result is that all numbers from 0 to 511 are present in the cube, i.e. uniform integral distribution, but this is not a magic cube.

When looked at in binary, the pattern created in the cube is much clearer. In every row the last three bits going from left to right are always: 000, 001, 010, 011, 111, 110, 101, 100. The other six bits of the binary numbers in each individual row are the same. In every column going from top to bottom, the middle three bits are the same as above and the other six bits of the binary number in each individual column are the same. In addition, in every pillar going from front to back the first three bits are again the same pattern as above with the last six bits of the binary number in each individual pillar being the same.

For the 6-D hypercube shown above, the first row contains the integers from 0 to 31 followed by 63 to 32. This series is the sum of the individual bits of the F0x0 plus 2 times F0xffff plus 4 times F0xff00ff plus ... plus 32 times F0x55555555 codes. This is a compatible group as defined in Base Cube Rules. The columns start with multiples of 64 from 0 to 1984, then 4032 to 2048. The pillars multiples of 4096 from 0 to 126,976 then 258,408 to 131,072. The files multiples of 262,144, etc. Again, resulting in uniform integral distribution but not the correct addition pattern. The pattern made by the binary bits is again very informative. Associated with the F group in every dimension is a group of six bits that first count up from 000000 to 011111 and then down from 111111 to 100000 for all the lines that go in that direction.

In general, for an n-D hypercube, the first row contains the integers from 0 to 2(n-1)-1 followed by 2n-1 to 2(n-1). The series is the sum of the individual bits of the N0x0 plus 2 times N0x(a series of 2(n-4) f's) plus 4 times N0x(a series of 2(n-5) f's, 2(n-5) 0's, and 2(n-5) f's) plus ... plus 32 times N0x(a series of 2(n-3) 5's) codes. The n bit codes (the full code not just the first half) can also be determined from the series:

• (2(2(n-2))-1)
• (2(2(n-2))-1)*(2(2(n-3))-1)
• (2(2(n-2))-1)*(2(2(n-3))+1)*(2(2(n-4))-1)
• (2(2(n-2))-1)*(2(2(n-3))+1)*(2(2(n-4))+1)*(2(2(n-5))-1)
• . . .
• (2(2(n-2))-1)*(2(2(n-3))+1)*(2(2(n-4))+1)*(. . .)*(2(2(2))+1)*(2(2(1))-1)
• (2(2(n-2))-1)*(2(2(n-3))+1)*(2(2(n-4))+1)*(. . .)*(2(2(2))+1)*(2(2(1))+1)*(2(2(0))-1)

Each of these codes contain 2(n) bits. Sequentially multiplying the codes by 1, 2, 4, ... , 2(n-1) and adding the resulting values at each position gives the integers from 0 to 2(n-1)-1 followed by 2n-1 to 2(n-1) as described above. This is a compatible group as defined in Base Cube Rules.

### Shuffling Matrix

The codes in the individual base lines of the compatible groups above are all non-repeating codes. The second half of these codes are always the inverse of the first half. An n-dimensional hypercube requires n different lettered base lines as a consequence of the hypercube's addition properties. For the other n-1 base lines in the base hypercube, the second half of the code is always the same as the first half. The cubes generated above are made entirely from non-repeating codes, with one such code in every base hypercube. To complete the cube only codes that repeat can be used.

The shuffling matrix is defined as the set of numbers in the hypercube determined by the vector (a, b, c, ... , n) where n is the number of dimensions in the hypercube and a, b, c, etc. are independently either 0 or n/2. On a base line, two bits that are separated by n/2 will always be inverses for the non-repeating codes and they will always be the same for the repeating codes. For the hypercubes created above, they will always be inverses.

As an example the shuffling matrix for the cube consists of the numbers at vectors (0,0,0), (4,0,0), (0,4,0), (4,4,0), (0,0,4), (4,0,4), (0,4,4), and (4,4,4). In the shuffling described in the section below pairs of numbers located (4,0,0), (0,4,0), and (0,0,4) vectors apart are very important. These are numbers spaced 4 apart in the rows, columns, and pillars respectively.

In the pattern described above the first six bits of pairs of numbers spaced a (4,0,0) vector apart are always the same. The last three bits or three least significant bits are always inverses, i.e. 010 and 101. In the shuffling matrix the numbers spaced 4 apart in the rows are the pairs at vectors (0,0,0) and (4,0,0), (0,4,0) and (4,4,0), (0,0,4) and (4,0,4), and (0,4,4) and (4,4,4).

In the above pattern the middle three bits spaced a (0,4,0) vector apart are always inverses while the other six bits of those numbers are always the same. These are the pairs at vectors (0,0,0) and (0,4,0), (4,0,0) and (4,4,0), (0,0,4) and (0,4,4), and (4,0,4) and (4,4,4) in the shuffling matrix. And the first three bits or three most significant bits spaced a (0,0,4) vector apart are always inverses while the last six bits of those numbers are always the same. These are the pairs at vectors (0,0,0) and (0,0,4), (4,0,0) and (4,0,4), (0,4,0) and (0,4,4), and (4,4,0) and (4,4,4).

In the sections below a series of steps will rearrange the numbers within a shuffling matrix but none of the characteristics of the shuffling matrix described in this section will change.

### Shuffling the numbers

Returning to the incomplete cube, we now put A0 into each of the last three column boxes. This reverses the two halves of each of the even numbered rows in every square counting from the top down. (These are actually xz planes 2, 4, 6, and 8 counted from the top down on the y axis.) For example, the second line down in square I now reads 15, 14, 13, 12, 8, 9, 10, 11 instead of 8, 9, 10, 11, 15, 14, 13, 12. Now enter the B0 code into each of the last three pillar boxes. This reverses the two halves of each of the rows in squares 3, 4, 7, and 8. (xy planes 3, 4, 7, and 8 along the z axis) Some rows are reversed back to where they started. Another way of describing the changes above is to say that the numbers in the affected rows underwent a (4,0,0) vector change.

It is clear when looking at the cube changes above that no numbers were lost, half were just moved to new locations. The changes appeared to occur within the selected rows but it is important to note the pattern of movement in all dimensions. Pick a number for the (0,0,0) position of a shuffling matrix. When the A0 code is placed in the last three column boxes above it either inverts the three least significant bits in the selected number or leaves them as is depending on whether a 1 or a 0 is in the A0 code for that column. The selected number is not the only number changed where the A0 code is a 1. The entire plane of numbers perpendicular to the column of the selected number is also changed. This includes the numbers that are (4,0,0), (0,0,4), and (4,0,4) vectors away from the selected number. Since the A0 code repeats for the second half of the line, the number a (0,4,0) vector away is also changed as well as the plane in which that number resides. This plane includes the numbers that are (4,4,0), (0,4,4), and (4,4,4) vectors away from the selected number. From this it can be seen that if the three least significant bits of one number in a shuffling matrix are changed then the three least significant bits in all the numbers in the shuffling matrix are changed. The change that occurs is the inversion of the last three bits of all eight numbers. The visual result is that each pair of numbers in the same row of the shuffling matrix exchanges positions and uniform integral distribution is maintained.

Similarly when the B0 code is placed in the last three pillar boxes it either inverts the three least significant bits in the selected number or leaves them as is depending on whether a 1 or a 0 is in the B0 code for that pillar. It is the entire plane of numbers perpendicular to the pillar of the selected number that is changed and the second plane changed is located a (0,0,4) vector from the first. Again, the three least significant bits of all numbers in the shuffling matrix are changed if one of them is changed resulting in shuffling of numbers but maintenance of uniform integral distribution.

When dealing with the 6-dimensional hypercube made with just F codes, the same approach as above is taken except that there are five dimensions to change with the five codes; A0, B0, C0, D0, and E0. The last six rather than last three bits of each number are affected when A0 is entered into the first column of base cubes 31 to 36. In the shuffling matrix, the entire 5-dimensional space associated with the selected number is altered when the selected number is changed. The first 32 bits are exchanged with the last 32 bits in the exchange or a (32,0,0,0,0,0) vector change. The second number located a (32,0,0,0,0,0) vector away from the selected number and the entire 5-dimensional space associated with that second number is also changed when the selected number is. This inverts the six least significant bits of all the numbers in the shuffling matrix. Again, no numbers are lost in the exchanges, the numbers are simply moved to new positions in the hypercube. A similar effect occurs when the B0, C0, D0, and E0 are entered into their respective positions of base cubes 31 to 36.

For an n-dimensional hypercube made with just N codes there will be n-1 dimensions requiring repeating base line codes. The A0, B0, etc. codes will be entered into the last n base cubes of a matrix similar to the 6-dimensional matrix shown above. The n least significant bits will be the only bits affected by the change, and that change will appear to exchange the first n/2 bits of the affected rows with the last n/2 bits. In the shuffling matrix, no numbers will be lost, they will just be moved.

### Uniform integral distribution and addition properties

Returning again to the incomplete cube we now put A0 into each of the middle three pillar boxes. This causes a (0,4,0) vector change in all the columns in the even numbered squares (xy planes 2, 4, 6, and 8 along the z axis). Enter the B0 code into each of the middle three row boxes. This results in a (0,4,0) vector change in columns 3, 4, 7, and 8 in every square (yz planes 3, 4, 7, and 8 along the x axis). For every pair of numbers that are exchanged, the three middle bits of the binary code are inverted. The other six bits of the exchanged numbers in each pair are unchanged.

Note that some of the numbers moved by changing the columns were previously moved when the rows were changed. Looking at the shuffling matrix we see that in the previous step if one of the numbers was moved all were moved and the movement was only an exchange of numbers in the same row. In that previous step if two numbers were in the same column or the same pillar before the exchange, they were still in the same column or pillar after the exchange. This step only exchanges numbers in the same column. If two numbers are in the same row or the same pillar before the exchange, they will still be in the same row or pillar after the exchange.

To complete the cube enter A0 into each of the first three row boxes. It should be apparent that this causes a (0,0,4) vector change to the even numbered columns of every square (yz planes 2, 4, 6, and 8 along the x axis). The change occurs in the direction of the pillars and not the direction of the columns. Addition of the B0 code to each of the first three column boxes causes a (0,0,4) vector change to the rows numbered 3, 4, 7, and 8 as counted from the top (xz planes 3, 4, 7, and 8 along the y axis). Again, the change occurs in the direction of the pillars and not the direction of the rows. Every exchange results only in the inversion of the first three bits of the nine bit binary code. The other six bits of the numbers in each pair are unchanged. Note that some of the numbers moved by exchanging pairs in the pillars were previously moved when the rows and/or columns were switched. But because of the simultaneous switch of the rows located (0,0,4) vectors apart during that exchange and the simultaneous switch of the columns located (0,0,4) vectors apart during that exchange, the last six bits of the switched pairs located (0,0,4) vectors apart are the same.

Starting with an intermediate cube with just the C codes, each step above has resulted only in movement of numbers to new locations. Uniform integral distribution was maintained throughout. The process has created a cube with A, B, and C codes in every base cube. As stated earlier if each base cube has A, B, and C codes then the addition properties will be correct. Therefore, the process has created a nasik magic cube.

Other than the added complexities of greater size and more dimensions, filling in the rest of the 6-dimensional hypercube follows the same procedure. There are six groups of six bits in the base line codes, one for each dimension. Every exchange involves inversion of only one of the six sets of six bits in the binary code with the other 30 bits remaining the same. The set of six bits that is modified is the same set created by the F codes in those rows of the matrix. It will cause the numbers spaced a vector of 32 apart along that dimensions axis in the shuffling matrix to exchange positions or remain unchanged in concert. No numbers will be lost from any shuffling matrix in the hypercube, they will only be moved to different positions within the shuffling matrix.

The process described above can be extended to hypercubes of any dimension with the assurance that the resulting hypercubes will be nasik.

### Variations

Most of the variations described above readily conform to the above proof. Using alternate B, C, D, etc. base line codes consistently throughout the hypercube just changes the order of the numbers in the initial lines it does not affect the shuffling effects. Modifying the A, B, C, D, etc. code order just places the codes in different dimensions where they accomplish the same task. Using different compatible N groups just reorders the numbers in the original lines. The initial construction will still have uniform integral distribution. Using different compatible N groups in each section makes sense when you consider that the codes in the same rows as that N group only affect the same n bits of the binary code as the N codes in that section. Using alternate A, B, C, etc. codes for each group of compatible N codes is OK because the codes associated with a given group of compatible N codes only effect that set of N codes.

The n base hypercubes of a valid nasik hypercube can be rearranged in any order. The concept behind this was described in the Multiplier Shuffling section of Basic Concepts. Rearrangement of the base hypercubes of a valid magic hypercube will always yield a new valid magic hypercube. Every valid nasik magic hypercube is thus one of n! easily determined different valid nasik magic hypercubes. Shuffling the hypercubes order does not obviously follow from the above proof but I feel it is adequately demonstrated elsewhere. In the proof above the base hypercubes with N codes in the same dimension have been grouped together. If each hypercube is observed separately, it will be seen that the shuffling matrix for each operates independently.

The only variation that is not explained is the ability to randomly modify either the left or right side of the matrix. I can't prove that, it is just an observation at this point.