# Shen:   regular and special patterns

Ching Tseng Shen's method is based on a square in a natural order, in which he reverses n/4 pairs of horizontally symmetrical columns and an equal number of vertically symmetrical rows. Thus, this process corresponds to the Method of reversions that Planck has already described.

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

For clarification, Shen marks the unchanged rows with `l` and the inverted rows with `r`, as well as the normal columns with `t` and the inverted with `b`.

•  8 7 6 5 4 3 2 1 r 9 10 11 12 13 14 15 16 l 24 23 22 21 20 19 18 17 r 25 26 27 28 29 30 31 32 l 33 34 35 36 37 38 39 40 l 48 47 46 45 44 43 42 41 r 49 50 51 52 53 54 55 56 l 64 63 62 61 60 59 58 57 r t b t b b t b t
•  8 63 6 61 60 3 58 1 r 9 50 11 52 53 14 55 16 l 24 47 22 45 44 19 42 17 r 25 34 27 36 37 30 39 32 l 33 26 35 28 29 38 31 40 l 48 23 46 21 20 43 18 41 r 49 10 51 12 13 54 15 56 l 64 7 62 5 4 59 2 57 r t b t b b t b t

For order n=4, Shen found exactly two of these symmetrical patterns, which he calls regular, namely `lrrl` and `rllr`. In contrast, six of these patterns already exist for n=8.

 llrrrrll lrrllrrl rlrllrlr lrlrrlrl rllrrllr rrllllrr

And for n=12 there exist already 20 patterns.

 lllrrrrrrlll lrlrlrrlrlrl rlllrrrrlllr rlrrllllrrlr llrlrrrrlrll lrlrrllrrlrl rllrlrrlrllr rrlllrrlllrr llrrlrrlrrll lrrllrrllrrl rllrrllrrllr rrllrllrllrr llrrrllrrrll lrrlrllrlrrl rlrllrrllrlr rrlrllllrlrr lrllrrrrllrl lrrrllllrrrl rlrlrllrlrlr rrrllllllrrr

These regular patterns can be transferred accordingly to the columns, where the code `lr` for the rows is replaced by `tb`, of course.

Any combination of these regular patterns creates a magic square, regardless of whether the rows are reversed first and then the columns according to their labels or vice versa. The resulting magic squares are always identical, regardless of the order of the exchanges.

### Special patterns

Shen goes one step further and also introduces special patterns. These are composed of any regular patterns of lower orders, and are of course no longer arranged symmetrically. For order n=12 there are, for example, the following 20 special patterns for the rows:

 llrrrrlllrrl rrllllrrlrrl lrrllrlrrlrl lrrlrlrllrlr rrllllrrrllr rllrllrrrrll rllrrlrllrlr lrrllrrlrllr lrrlllrrrrll lrrlrrllllrr lrlrrlrlrllr rllrrllrlrrl rllrrrllllrr lrlrrlrllrrl rlrllrlrlrrl rllrlrrllrrl llrrrrllrllr rlrllrlrrllr rllrlrlrrlrl lrrlrllrrllr

With regular and special patterns, additional magic squares can now be created, whereby the order of the exchanges is important here.

• Choose a regular pattern for the rows and a special pattern for the columns, and reverse the rows first and then the columns.
• Choose a special pattern for the columns and a regular pattern for the columns, and reverse the columns first and then the rows.

Such an example with a regular pattern for the rows and a special pattern for the columns is shown in the following figure for a 12th-order square. Here are the rows reversed in the first step

 1 2 3 4 5 6 7 8 9 10 11 12 l 24 23 22 21 20 19 18 17 16 15 14 13 r 25 26 27 28 29 30 31 32 33 34 35 36 l 37 38 39 40 41 42 43 44 45 46 47 48 l 60 59 58 57 56 55 54 53 52 51 50 49 r 72 71 70 69 68 67 66 65 64 63 62 61 r 84 83 82 81 80 79 78 77 76 75 74 73 r 96 95 94 93 92 91 90 89 88 87 86 85 r 97 98 99 100 101 102 103 104 105 106 107 108 l 109 110 111 112 113 114 115 116 117 118 119 120 l 132 131 130 129 128 127 126 125 124 123 122 121 r 133 134 135 136 137 138 139 140 141 142 143 144 l b t b t t b t b b t t b

and the columns later. The result is a magic square.

 133 2 135 4 5 138 7 140 141 10 11 144 l 132 23 130 21 20 127 18 125 124 15 14 121 r 109 26 111 28 29 114 31 116 117 34 35 120 l 97 38 99 40 41 102 43 104 105 46 47 108 l 96 59 94 57 56 91 54 89 88 51 50 85 r 84 71 82 69 68 79 66 77 76 63 62 73 r 72 83 70 81 80 67 78 65 64 75 74 61 r 60 95 58 93 92 55 90 53 52 87 86 49 r 37 98 39 100 101 42 103 44 45 106 107 48 l 25 110 27 112 113 30 115 32 33 118 119 36 l 24 131 22 129 128 19 126 17 16 123 122 13 r 1 134 3 136 137 6 139 8 9 142 143 12 l b t b t t b t b b t t b