Mathematically a composite number is an integer that is a combination of two or more primes. By that definition, the squares discussed in Order-2^{p} Squares and Order-3^{p} Squares and the powers of primes are composites. This section will concentrate only on composites of more than one prime, not the powers of primes. The discussion will be split into even and odd composites, as they must be treated differently.

It has been proven that squares of singly even order cannot be pan-magic. All squares of doubly even order can be pan-magic. Thus, the order-12 pan-magic squares are the smallest that will be considered here. I initially became interested in the order-12 squares during a discussion with Aale de Winkel about the implications of the compact term. I thought I had proof that {^{2}compact_{4}} meant that the figure was also {^{2}compact_{2}}. He pointed out that the proof did not work for order-12 squares. My proof was confined to order-2^{p} figures. A further discussion of this is given below.

Order-12 base squares must be either binary or ternary. The order-12 pan-magic squares are constructed from 4 binary base squares and 2 ternary base squares. This creates a number of construction challenges. For instance, the {^{2}compact_{2}} feature can be expressed in the binary base squares but not the ternary base squares. Thus, it cannot be expressed in an order-12 pan-magic square made from base lines. {^{2}Compact_{2}} order-12 pan-magic squares can be made in other ways. There is an example below. My son Neil put together a program to create order-12 pan-magic from base lines and the examples below are largely a result of that effort. The order of the base squares can be shuffled as with the other constructions. Base squares 5 and 6 are always ternary base squares and the others binary. The base square order can be shuffled in any order to give a new order-12 pan-magic square with the same properties. There must be no repeats in the base cube order, however.

Square 1 is {^{2}compact_{7}}. If it were to follow the pattern based on order-2^{p} squares, it would also be expected to be but {^{2}compact_{3}} and complete. It is neither.

Square 2 is just pan-magic with no special feature except a feature my son calls quadplete. This is the sum of 16 numbers evenly spaced in a grid pattern is any 10x10 sub-square within the order-12 square. Every order-12 pan-magic square I have examined has this feature.

Square 3 is {^{2}compact_{7}} and complete.

Square 4 has both Franklin V and what I call Franklin VW bent diagonals. The VW bent diagonals as the letters imply go back and forth three times while crossing the square. A Franklin W type bent diagonal is not possible.

Square 5 is {^{2}compact_{4}} but it is not {^{2}compact_{2 or 6}}. This square also has both Franklin V and Franklin VW bent diagonals.

Square 6 has four inlaid order-3 magic squares. They have their upper left corners at positions (4,4), (10,4), (4,10), and (10,10).

Square 7 has sixteen order-3 magic squares in a grid arrangement. Notice that the 1 is not in the upper left corner because an order-3 square cannot have its 1 in a corner. The order-12 square is also {^{2}compact_{7}} and complete.

The numbers in square 8 are only slightly different from those in square 7 but it is {^{2}compact_{4}}, not {^{2}compact_{7}} and not complete.

In general for any odd order-o where o is not divisible by 3, the two series x mod o and 2x mod o can always be used as base lines to make pan-magic base squares with 0 ≤ x < o. When o = 3 the two series are the same (one forward and one backward), thus a pan-magic square cannot be made. For larger odd order-o squares divisible by 3, the two series will always give incorrect diagonals in one direction. Squares that are orders that are singly divisible by 3 can be pan-magic. For instance, John R. Hendricks created an order-15 pan-magic square. It does not appear, however, that these squares can be created using base lines. Composites of two different primes ≥ 5 must be ≥ 35. Squares of these orders are relatively easy to make from base lines.

More generally when o is prime, the two series rx mod o and sx mod o will create base lines that always make pan-magic base squares with 0 ≤ x < o. For composite numbers not divisible by 3, the additional restriction that r and s must not be factors of o must be applied. Even with that restriction, there are many other combinations of r and s series that do not give pan-magic base squares but there are many that do.

Two order-o base squares must be combined by multiplying one base square by o and adding the second. This will not always yield a valid pan-magic square for squares of composite order but will always yield a pan-magic square for squares of prime order. Uniform integral distribution must be confirmed for the composite squares. I believe that the two base squares o(x mod o and 2x mod o) plus (2x mod o and x mod o) will always yield a pan-magic square where the series in parenthesis represent the row and column base lines needed to make the base squares.

There are four order-35 pan-magic squares shown on the 35x35 worksheet of the *SquareLines* Excel Spreadsheet available on the Downloads page. The first two master base line sets are squares made as described above. The second is associated, the first is not.

The third and fourth magic squares on the worksheet are made by multiplying an order-5 pan-magic square by an order-7 pan-magic square and vice versa. The same two associated pan-magic squares were used for both multiplications. Both order-35 squares are associated but the top row and left column are not master base lines. The squares cannot be made from master base lines like the order-25 multiplied squares. Multiplication of master base lines does not work unless both base lines are the same length.

144 | 1 | 120 | 121 | 48 | 85 | 72 | 73 | 60 | 97 | 24 | 25 |

3 | 142 | 27 | 22 | 99 | 58 | 75 | 70 | 87 | 46 | 123 | 118 |

134 | 11 | 110 | 131 | 38 | 95 | 62 | 83 | 50 | 107 | 14 | 35 |

9 | 136 | 33 | 16 | 105 | 52 | 81 | 64 | 93 | 40 | 129 | 112 |

137 | 8 | 113 | 128 | 41 | 92 | 65 | 80 | 53 | 104 | 17 | 32 |

7 | 138 | 31 | 18 | 103 | 54 | 79 | 66 | 91 | 42 | 127 | 114 |

140 | 5 | 116 | 125 | 44 | 89 | 68 | 77 | 56 | 101 | 20 | 29 |

6 | 139 | 30 | 19 | 102 | 55 | 78 | 67 | 90 | 43 | 126 | 115 |

133 | 12 | 109 | 132 | 37 | 96 | 61 | 84 | 49 | 108 | 13 | 36 |

10 | 135 | 34 | 15 | 106 | 51 | 82 | 63 | 94 | 39 | 130 | 111 |

143 | 2 | 119 | 122 | 47 | 86 | 71 | 74 | 59 | 98 | 23 | 26 |

4 | 141 | 28 | 21 | 100 | 57 | 76 | 69 | 88 | 45 | 124 | 117 |

There is a proof in Magic Constant Groups that if a cube is {^{2}compact_{2}} it is also {^{2}compact_{4}} or any other even number. An order-12 example that is {^{2}compact_{2,4,6}} is shown at right. This proof is easily extended to figures of any number of dimensions and/or order. At the time that this was originally written I thought I had also proved that a figure that is {^{2}compact_{4}} is also {^{2}compact_{2}}. However, that proof only works for figures of order-2^{p}.

Since the proof works with any number of dimensions, the easiest number of dimensions to work with is one or a line. A simplified proof thus follows: For an order-8 line call the values a b c d e f g h. If this line is {^{1}compact_{2}} then a+b = b+c = c+d = d+e = etc. Since b+c = c+d then b = d. Thus by substitution a+b = a+d. Proving that the line is also {^{1}compact_{4}}.

As an example, for the {^{2}compact_{2,4,6}} square at right, let a = 33+113 = 146, then b = 16+128 = 144, c = 105+41 = 146, and d = 52+92 = 144. Thus a+b = a+d as above. The four pairs of numbers could start at any point in the order-12 square with the same result.

For the converse if the above order-8 line is {^{1}compact_{4}} then a+d = b+e = c+f = d+g = e+h = f+a = g+b = h+c. The last three require wraparound. Since d+g = g+b then d = b. Thus by substitution a+d = a+b. Proving that the line is also {^{1}compact_{2}}.

1 | 121 | 36 | 129 | 4 | 124 | 30 | 132 | 7 | 118 | 33 | 135 |

65 | 95 | 44 | 83 | 68 | 98 | 38 | 86 | 71 | 92 | 41 | 89 |

117 | 15 | 136 | 25 | 114 | 12 | 142 | 22 | 111 | 18 | 139 | 19 |

106 | 58 | 75 | 54 | 103 | 55 | 81 | 51 | 100 | 61 | 78 | 48 |

2 | 122 | 35 | 128 | 5 | 125 | 29 | 131 | 8 | 119 | 32 | 134 |

66 | 96 | 43 | 82 | 69 | 99 | 37 | 85 | 72 | 93 | 40 | 88 |

115 | 13 | 138 | 27 | 112 | 10 | 144 | 24 | 109 | 16 | 141 | 21 |

107 | 59 | 74 | 53 | 104 | 56 | 80 | 50 | 101 | 62 | 77 | 47 |

3 | 123 | 34 | 127 | 6 | 126 | 28 | 130 | 9 | 120 | 31 | 133 |

64 | 94 | 45 | 84 | 67 | 97 | 39 | 87 | 70 | 91 | 42 | 90 |

116 | 14 | 137 | 26 | 113 | 11 | 143 | 23 | 110 | 17 | 140 | 20 |

108 | 60 | 73 | 52 | 105 | 57 | 79 | 49 | 102 | 63 | 76 | 46 |

For an order-12 line, a b c d e f g h i j k l, {^{1}compact_{2}} still means that the line is also {^{1}compact_{4}}. It is also {^{1}compact_{6}} by the same logic. The converse, however, does not follow. If the line is {^{1}compact_{4}} then a+d = b+e = c+f = d+g = e+h = f+i = g+j = h+k = i+l = j+a = k+b = l+c. Since d+g = g+j then g = j. By substitution a+d = a+j but a and j are 4 apart which is still {^{1}compact_{4}}. No substitution will give a different level of compact, thus {^{1}compact_{4}} does not imply {^{1}compact_{2}}. Squares 5 and 8 in the Order-12 Pan-Magic Squares generator above illustrate this fact.

If the order-12 line is {^{1}compact_{6}}, however, it must also be {^{1}compact_{2}}. For a {^{1}compact_{6}} line, a+f = f+k = k+d = d+i = i+b. Therefore f = d and d = b and thus f = b and by substitution a+f = a+b.

Similarly if the order-12 line is {^{1}compact_{3}} then it must also be {^{1}compact_{7}} like the {^{1}compact_{3,7}} at right. To see this a+c = b+d = c+e = d+f = e+g = etc. Since c+e = e+g then c = g. Thus by substitution a+c = a+g. Proving that the line is also {^{1}compact_{7}}. The converse, however, does not follow, i.e. {^{1}compact_{7}} does not imply {^{1}compact_{3}}.

8 | 1 | 6 | 65 | 72 | 67 | 116 | 109 | 114 | 101 | 108 | 103 |

3 | 5 | 7 | 70 | 68 | 66 | 111 | 113 | 115 | 106 | 104 | 102 |

4 | 9 | 2 | 69 | 64 | 71 | 112 | 117 | 110 | 105 | 100 | 107 |

125 | 118 | 123 | 92 | 99 | 94 | 17 | 10 | 15 | 56 | 63 | 58 |

120 | 122 | 124 | 97 | 95 | 93 | 12 | 14 | 16 | 61 | 59 | 57 |

121 | 126 | 119 | 96 | 91 | 98 | 13 | 18 | 11 | 60 | 55 | 62 |

29 | 36 | 31 | 44 | 37 | 42 | 137 | 144 | 139 | 80 | 73 | 78 |

34 | 32 | 30 | 39 | 41 | 43 | 142 | 140 | 138 | 75 | 77 | 79 |

33 | 28 | 35 | 40 | 45 | 38 | 141 | 136 | 143 | 76 | 81 | 74 |

128 | 135 | 130 | 89 | 82 | 87 | 20 | 27 | 22 | 53 | 46 | 51 |

133 | 131 | 129 | 84 | 86 | 88 | 25 | 23 | 21 | 48 | 50 | 52 |

132 | 127 | 134 | 85 | 90 | 83 | 24 | 19 | 26 | 49 | 54 | 47 |

An example in the {^{2}compact_{3,7}} square could be 15+122 = 137. Then c would be 25+128 = 153, e would be 12+125 = 137, and g would be 22+131 = 153. Thus a+c = a+g as above proving that {^{2}compact_{3}} implies {^{2}compact_{7}}. Squares 1, 3, and 7 in the Order-12 Pan-Magic Squares generator above illustrate the fact that {^{2}compact_{7}} does not imply {^{2}compact_{3}}.

The next order-12 pan-magic square at right was contributed by Aale De Winkel. It is {^{2}Compact_{4,7}} but neither {^{2}compact_{2}} nor {^{2}compact_{3}}. The square is also complete and has 16 inlaid order-3 magic squares.

Generalizing, for order-4n squares, assuming that the magic square is large enough and/or wraparound is used, a square that is {^{2}compact_{x}} is also {^{2}compact_{(2(x-1)y}}. This is also true for figures of any number of dimensions.

Generally a square that is {^{2}compact_{(2(x-1)y}} will also be {^{2}compact_{x}}. But if (2(x-1)y-1) is a factor of the squares order or is an odd multiple of that factor then {^{2}compact_{(2(x-1)y}} does not imply {^{2}compact_{x}}. For example, for an order-28 square, {^{2}compact_{8 or 22}} does not imply {^{2}compact_{2}}. But if the square is {^{2}compact_{2}} it must also be {^{2}compact_{8,22}}. Seven, (8-1), is a factor of the squares order, 28, and 21, (22-1) is 7 + order/2. (15-1) is also a factor of the order and thus {^{2}compact_{15}} does not imply {^{2}compact_{3}}, but {^{2}compact_{7, 11, or 19}} do imply {^{2}compact_{3,7,11,15,19}}