' Constructs Simple Magic Cubes (6 x 6 x 6)
' Trenkler Principle
' Tested with Office 2007 under Windows 7
Sub MgcCube6a()
Dim a1(4), c(216), b(6), b1(27), a(216)
y = MsgBox("Blocked", 0, "MgcCube6a")
End
Sheets("Klad1").Select
a1(1) = 0: a1(2) = 3: a1(3) = 5: a1(4) = 6:
' Define Simple Magic Cube
b1(19) = 10: b1(20) = 8: b1(21) = 24: b1(22) = 5: b1(23) = 21: b1(24) = 16: b1(25) = 27: b1(26) = 13: b1(27) = 2:
b1(10) = 6: b1(11) = 19: b1(12) = 17: b1(13) = 25: b1(14) = 14: b1(15) = 3: b1(16) = 11: b1(17) = 9: b1(18) = 22:
b1(1) = 26: b1(2) = 15: b1(3) = 1: b1(4) = 12: b1(5) = 7: b1(6) = 23: b1(7) = 4: b1(8) = 20: b1(9) = 18:
n1 = 0: n9 = 0: n10 = 0: k1 = 1: k2 = 1
t1 = Timer
' Center Planes
For j108 = 1 To 4
c(108) = a1(j108)
For j107 = 1 To 4
If j107 = j108 Then GoTo 1070
c(107) = a1(j107)
For j106 = 1 To 4
c(106) = a1(j106)
For j105 = 1 To 4
If j105 = j106 Then GoTo 1050
c(105) = a1(j105)
For j104 = 1 To 4
c(104) = a1(j104)
c(103) = 21 - c(104) - c(105) - c(106) - c(107) - c(108)
If c(103) <> a1(1) And c(103) <> a1(2) And c(103) <> a1(3) And c(103) <> a1(4) Then GoTo 1040
If c(103) = c(104) Then GoTo 1040
For j102 = 1 To 4
c(102) = a1(j102)
If j102 = j107 Or j102 = j108 Then GoTo 1020
c(101) = 14 - c(102) - c(107) - c(108)
For j100 = 1 To 4
c(100) = a1(j100)
If j100 = j105 Or j100 = j106 Then GoTo 1000
c(99) = 14 - c(100) - c(105) - c(106)
For j98 = 1 To 4
c(98) = a1(j98)
If c(98) = c(103) Or c(98) = c(104) Then GoTo 980
c(97) = 14 - c(98) - c(103) - c(104)
For j96 = 1 To 4
c(96) = a1(j96)
For j95 = 1 To 4
If j95 = j96 Then GoTo 950
c(95) = a1(j95)
For j94 = 1 To 4
c(94) = a1(j94)
For j93 = 1 To 4
If j93 = j94 Then GoTo 930
c(93) = a1(j93)
For j92 = 1 To 4
c(92) = a1(j92)
c(91) = 21 - c(92) - c(93) - c(94) - c(95) - c(96)
If c(91) <> a1(1) And c(91) <> a1(2) And c(91) <> a1(3) And c(91) <> a1(4) Then GoTo 920
If c(91) = c(92) Then GoTo 920
For j90 = 1 To 4
c(90) = a1(j90)
If j90 = j95 Or j90 = j96 Then GoTo 900
c(89) = 14 - c(90) - c(95) - c(96)
For j88 = 1 To 4
c(88) = a1(j88)
If j88 = j93 Or j88 = j94 Then GoTo 880
c(87) = 14 - c(88) - c(93) - c(94)
For j86 = 1 To 4
c(86) = a1(j86)
If c(86) = c(91) Or c(86) = c(92) Then GoTo 860
c(85) = 14 - c(86) - c(91) - c(92)
For j84 = 1 To 4
c(84) = a1(j84)
c(78) = 21 - c(84) - c(90) - c(96) - c(102) - c(108)
If c(78) <> a1(1) And c(78) <> a1(2) And c(78) <> a1(3) And c(78) <> a1(4) Then GoTo 840
For j83 = 1 To 4
If j83 = j84 Then GoTo 830
c(83) = a1(j83)
c(77) = 14 - c(78) - c(83) - c(84)
If c(77) <> a1(1) And c(77) <> a1(2) And c(77) <> a1(3) And c(77) <> a1(4) Then GoTo 830
For j82 = 1 To 4
c(82) = a1(j82)
c(76) = 21 - c(82) - c(88) - c(94) - c(100) - c(106)
If c(76) <> a1(1) And c(76) <> a1(2) And c(76) <> a1(3) And c(76) <> a1(4) Then GoTo 820
For j81 = 1 To 4
If j81 = j82 Then GoTo 810
c(81) = a1(j81)
c(75) = 14 - c(76) - c(81) - c(82)
If c(75) <> a1(1) And c(75) <> a1(2) And c(75) <> a1(3) And c(75) <> a1(4) Then GoTo 810
For j80 = 1 To 4
c(80) = a1(j80)
c(79) = 21 - c(80) - c(81) - c(82) - c(83) - c(84)
If c(79) <> a1(1) And c(79) <> a1(2) And c(79) <> a1(3) And c(79) <> a1(4) Then GoTo 800
If c(79) = c(80) Then GoTo 800
c(74) = 21 - c(80) - c(86) - c(92) - c(98) - c(104)
If c(74) <> a1(1) And c(74) <> a1(2) And c(74) <> a1(3) And c(74) <> a1(4) Then GoTo 800
c(73) = 14 - c(74) - c(79) - c(80)
If c(73) <> a1(1) And c(73) <> a1(2) And c(73) <> a1(3) And c(73) <> a1(4) Then GoTo 800
For i1 = 73 To 108
c(i1 + 36) = 7 - c(i1)
Next i1
' Space Diagonal 1
For j8 = 1 To 4
c(8) = a1(j8)
For j7 = 1 To 4
If j7 = j8 Then GoTo 70
c(7) = a1(j7)
For j2 = 1 To 4
If j2 = j7 Or j2 = j8 Then GoTo 20
c(2) = a1(j2)
c(1) = 14 - c(2) - c(7) - c(8)
c(37) = 7 - c(1): c(38) = 7 - c(2):
c(43) = 7 - c(7): c(44) = 7 - c(8):
For j180 = 1 To 4
c(180) = a1(j180)
For j179 = 1 To 4
If j179 = j180 Then GoTo 1790
c(179) = a1(j179)
For j174 = 1 To 4
If j174 = j179 Or j174 = j180 Then GoTo 1740
c(174) = a1(j174)
c(173) = 14 - c(174) - c(179) - c(180)
c(209) = 7 - c(173): c(210) = 7 - c(174):
c(215) = 7 - c(179): c(216) = 7 - c(180):
If c(1) + c(44) + c(87) + c(130) + c(173) + c(216) <> 21 Then GoTo 1740
' Space Diagonal 2
For j12 = 1 To 4
c(12) = a1(j12)
For j11 = 1 To 4
If j11 = j12 Then GoTo 110
c(11) = a1(j11)
For j6 = 1 To 4
If j6 = j11 Or j6 = j12 Then GoTo 60
c(6) = a1(j6)
c(5) = 14 - c(6) - c(11) - c(12)
c(41) = 7 - c(5): c(42) = 7 - c(6):
c(47) = 7 - c(11): c(48) = 7 - c(12):
For j176 = 1 To 4
c(176) = a1(j176)
For j175 = 1 To 4
If j175 = j176 Then GoTo 1750
c(175) = a1(j175)
For j170 = 1 To 4
If j170 = j175 Or j170 = j176 Then GoTo 1700
c(170) = a1(j170)
c(169) = 14 - c(170) - c(175) - c(176)
c(205) = 7 - c(169): c(206) = 7 - c(170):
c(211) = 7 - c(175): c(212) = 7 - c(176):
If c(6) + c(47) + c(88) + c(129) + c(170) + c(211) <> 21 Then GoTo 1700
' Space Diagonal 3
For j32 = 1 To 4
c(32) = a1(j32)
For j31 = 1 To 4
If j31 = j32 Then GoTo 310
c(31) = a1(j31)
For j26 = 1 To 4
If j26 = j31 Or j26 = j32 Then GoTo 260
c(26) = a1(j26)
c(25) = 14 - c(26) - c(31) - c(32)
c(61) = 7 - c(25): c(62) = 7 - c(26):
c(67) = 7 - c(31): c(68) = 7 - c(32):
For j156 = 1 To 4
c(156) = a1(j156)
For j155 = 1 To 4
If j155 = j156 Then GoTo 1550
c(155) = a1(j155)
For j150 = 1 To 4
If j150 = j155 Or j150 = j156 Then GoTo 1500
c(150) = a1(j150)
c(149) = 14 - c(150) - c(155) - c(156)
c(185) = 7 - c(149): c(186) = 7 - c(150):
c(191) = 7 - c(155): c(192) = 7 - c(156):
If c(31) + c(62) + c(93) + c(124) + c(155) + c(186) <> 21 Then GoTo 1500
' Space Diagonal 4
For j36 = 1 To 4
c(36) = a1(j36)
For j35 = 1 To 4
If j35 = j36 Then GoTo 350
c(35) = a1(j35)
For j30 = 1 To 4
If j30 = j35 Or j30 = j36 Then GoTo 300
c(30) = a1(j30)
c(29) = 14 - c(30) - c(35) - c(36)
c(65) = 7 - c(29): c(66) = 7 - c(30):
c(71) = 7 - c(35): c(72) = 7 - c(36):
For j152 = 1 To 4
c(152) = a1(j152)
For j151 = 1 To 4
If j151 = j152 Then GoTo 1510
c(151) = a1(j151)
For j146 = 1 To 4
If j146 = j151 Or j146 = j152 Then GoTo 1460
c(146) = a1(j146)
c(145) = 14 - c(146) - c(151) - c(152)
c(181) = 7 - c(145): c(182) = 7 - c(146):
c(187) = 7 - c(151): c(188) = 7 - c(152):
If c(36) + c(65) + c(94) + c(123) + c(152) + c(181) <> 21 Then GoTo 1460
' Complete Bottom
For j34 = 1 To 4
c(34) = a1(j34)
c(33) = 21 - c(31) - c(32) - c(34) - c(35) - c(36)
If c(33) <> a1(1) And c(33) <> a1(2) And c(33) <> a1(3) And c(33) <> a1(4) Then GoTo 340
If c(33) = c(34) Then GoTo 340
For j28 = 1 To 4
c(28) = a1(j28)
If c(28) = c(34) Or c(28) = c(33) Then GoTo 280
c(27) = 14 - c(28) - c(33) - c(34)
For j10 = 1 To 4
c(10) = a1(j10)
c(9) = 21 - c(7) - c(8) - c(10) - c(11) - c(12)
If c(9) <> a1(1) And c(9) <> a1(2) And c(9) <> a1(3) And c(9) <> a1(4) Then GoTo 100
If c(9) = c(10) Then GoTo 100
For j4 = 1 To 4
c(4) = a1(j4)
If c(4) = c(9) Or c(4) = c(10) Then GoTo 40
c(3) = 14 - c(4) - c(9) - c(10)
For j24 = 1 To 4
c(24) = a1(j24)
c(18) = 21 - c(24) - c(30) - c(36) - c(6) - c(12)
If c(18) <> a1(1) And c(18) <> a1(2) And c(18) <> a1(3) And c(18) <> a1(4) Then GoTo 240
If c(18) = c(24) Then GoTo 240
For j23 = 1 To 4
c(23) = a1(j23)
If c(23) = c(24) Or c(23) = c(18) Then GoTo 230
c(17) = 14 - c(18) - c(23) - c(24)
For j22 = 1 To 4
c(22) = a1(j22)
c(16) = 21 - c(22) - c(28) - c(34) - c(4) - c(10)
If c(16) <> a1(1) And c(16) <> a1(2) And c(16) <> a1(3) And c(16) <> a1(4) Then GoTo 220
If c(16) = c(22) Then GoTo 220
For j21 = 1 To 4
c(21) = a1(j21)
If c(21) = c(22) Or c(21) = c(16) Then GoTo 210
c(15) = 14 - c(16) - c(21) - c(22)
For j20 = 1 To 4
c(20) = a1(j20)
c(19) = 21 - c(20) - c(21) - c(22) - c(23) - c(24)
If c(19) <> a1(1) And c(19) <> a1(2) And c(19) <> a1(3) And c(19) <> a1(4) Then GoTo 200
If c(19) = c(20) Then GoTo 200
c(14) = 21 - c(20) - c(26) - c(32) - c(2) - c(8)
If c(14) <> a1(1) And c(14) <> a1(2) And c(14) <> a1(3) And c(14) <> a1(4) Then GoTo 200
If c(14) = c(19) Or c(14) = c(20) Then GoTo 200
c(13) = 14 - c(14) - c(19) - c(20)
If c(13) <> a1(1) And c(13) <> a1(2) And c(13) <> a1(3) And c(13) <> a1(4) Then GoTo 200
For i1 = 1 To 36
c(i1 + 36) = 7 - c(i1)
Next i1
' Complete Top
For j178 = 1 To 4
c(178) = a1(j178)
c(177) = 21 - c(175) - c(176) - c(178) - c(179) - c(180)
If c(177) <> a1(1) And c(177) <> a1(2) And c(177) <> a1(3) And c(177) <> a1(4) Then GoTo 1780
If c(177) = c(178) Then GoTo 1780
For j172 = 1 To 4
c(172) = a1(j172)
If c(172) = c(178) Or c(172) = c(177) Then GoTo 1720
c(171) = 14 - c(172) - c(177) - c(178)
For j154 = 1 To 4
c(154) = a1(j154)
c(153) = 21 - c(151) - c(152) - c(154) - c(155) - c(156)
If c(153) <> a1(1) And c(153) <> a1(2) And c(153) <> a1(3) And c(153) <> a1(4) Then GoTo 1540
If c(153) = c(154) Then GoTo 1540
For j148 = 1 To 4
c(148) = a1(j148)
If c(148) = c(153) Or c(148) = c(154) Then GoTo 1480
c(147) = 14 - c(148) - c(153) - c(154)
For j168 = 1 To 4
c(168) = a1(j168)
c(162) = 21 - c(168) - c(174) - c(180) - c(150) - c(156)
If c(162) <> a1(1) And c(162) <> a1(2) And c(162) <> a1(3) And c(162) <> a1(4) Then GoTo 1680
If c(162) = c(168) Then GoTo 1680
For j167 = 1 To 4
c(167) = a1(j167)
If c(167) = c(168) Or c(167) = c(162) Then GoTo 1670
c(161) = 14 - c(162) - c(167) - c(168)
For j166 = 1 To 4
c(166) = a1(j166)
c(160) = 21 - c(166) - c(172) - c(178) - c(148) - c(154)
If c(160) <> a1(1) And c(160) <> a1(2) And c(160) <> a1(3) And c(160) <> a1(4) Then GoTo 1660
If c(160) = c(166) Then GoTo 1660
For j165 = 1 To 4
c(165) = a1(j165)
If c(165) = c(166) Or c(165) = c(160) Then GoTo 1650
c(159) = 14 - c(160) - c(165) - c(166)
For j164 = 1 To 4
c(164) = a1(j164)
c(163) = 21 - c(164) - c(165) - c(166) - c(167) - c(168)
If c(163) <> a1(1) And c(163) <> a1(2) And c(163) <> a1(3) And c(163) <> a1(4) Then GoTo 1640
If c(163) = c(164) Then GoTo 1640
c(158) = 21 - c(164) - c(170) - c(176) - c(146) - c(152)
If c(158) <> a1(1) And c(158) <> a1(2) And c(158) <> a1(3) And c(158) <> a1(4) Then GoTo 1640
If c(158) = c(163) Or c(158) = c(164) Then GoTo 1640
c(157) = 14 - c(158) - c(163) - c(164)
If c(157) <> a1(1) And c(157) <> a1(2) And c(157) <> a1(3) And c(157) <> a1(4) Then GoTo 1640
For i1 = 145 To 180
c(i1 + 36) = 7 - c(i1)
Next i1
MC6 = 21: GoSub 2000: If fl1 = 0 Then GoTo 1640 'Back Check Trenkler Cube
GoSub 2800 'Contruct Simple Magic Cube
GoSub 2850: If fl1 = 0 Then GoTo 1640 'Back Check Identical Numbers
n9 = n9 + 1: GoSub 2750 'Print Cube
1640 Next j164
1650 Next j165
1660 Next j166
1670 Next j167
1680 Next j168
1480 Next j148
1540 Next j154
1720 Next j172
1780 Next j178
200 Next j20
210 Next j21
220 Next j22
230 Next j23
240 Next j24
40 Next j4
100 Next j10
280 Next j28
340 Next j34
1460 Next j146
1510 Next j151
1520 Next j152
300 Next j30
350 Next j35
360 Next j36
1500 Next j150
1550 Next j155
1560 Next j156
260 Next j26
310 Next j31
320 Next j32
1700 Next j170
1750 Next j175
1760 Next j176
60 Next j6
110 Next j11
120 Next j12
1740 Next j174
1790 Next j179
1800 Next j180
20 Next j2
70 Next j7
80 Next j8
800 Next j80
810 Next j81
820 Next j82
830 Next j83
840 Next j84
860 Next j86
880 Next j88
900 Next j90
920 Next j92
930 Next j93
940 Next j94
950 Next j95
960 Next j96
980 Next j98
1000 Next j100
1020 Next j102
1040 Next j104
1050 Next j105
1060 Next j106
1070 Next j107
1080 Next j108
t2 = Timer
t10 = Str(t2 - t1) + " sec., " + Str(n9) + " Solutions"
y = MsgBox(t10, 0, "Routine MgcCube6a")
End
' Back Check Magic Constant
2000 fl1 = 1
' Rows
i1 = -5
For i0 = 1 To 36
i1 = i1 + 6
b(1) = c(i1): b(2) = c(i1 + 1): b(3) = c(i1 + 2): b(4) = c(i1 + 3): b(5) = c(i1 + 4): b(6) = c(i1 + 5)
GoSub 2860
If fl1 = 0 Then Return
Next i0
' Columns
i1 = 0: i2 = 0
For i0 = 1 To 36
i1 = i1 + 1
b(1) = c(i1): b(2) = c(i1 + 6): b(3) = c(i1 + 12): b(4) = c(i1 + 18): b(5) = c(i1 + 24): b(6) = c(i1 + 30)
i2 = i2 + 1: If i2 = 6 Then i2 = 0: i1 = i1 + 30
GoSub 2860
If fl1 = 0 Then Return
Next i0
' Pillars
i1 = 0: i2 = 0
For i0 = 1 To 36
i1 = i0
b(1) = c(i1): b(2) = c(i1 + 36): b(3) = c(i1 + 72): b(4) = c(i1 + 108): b(5) = c(i1 + 144): b(6) = c(i1 + 180)
GoSub 2860
If fl1 = 0 Then Return
Next i0
' Space Diagonals
fl1 = 1
If c(1) + c(44) + c(87) + c(130) + c(173) + c(216) <> MC6 Then fl1 = 0: Return
If c(6) + c(47) + c(88) + c(129) + c(170) + c(211) <> MC6 Then fl1 = 0: Return
If c(31) + c(62) + c(93) + c(124) + c(155) + c(186) <> MC6 Then fl1 = 0: Return
If c(36) + c(65) + c(94) + c(123) + c(152) + c(181) <> MC6 Then fl1 = 0: Return
Return
' Check MC6
2860 fl1 = 1
If b(1) + b(2) + b(3) + b(4) + b(5) + b(6) <> MC6 Then fl1 = 0
Return
' Print Cubes (6 plane format)
2750 n2 = n2 + 1
If n2 = 5 Then
n2 = 1: k1 = k1 + 42: k2 = 1
Else
If n9 > 1 Then k2 = k2 + 7
End If
Cells(k1, k2 + 1).Select
Cells(k1, k2 + 1).Font.Color = -4165632
Cells(k1, k2 + 1).Value = n9
For i0 = 1 To 6
i3 = (6 - i0) * 36
For i1 = 1 To 6
For i2 = 1 To 6
i3 = i3 + 1
' Cells(k1 + i1 + (i0 - 1) * 7, k2 + i2).Value = c(i3) 'Trenkler Cube
Cells(k1 + i1 + (i0 - 1) * 7, k2 + i2).Value = a(i3) 'Simple Magic Cube
Next i2
Next i1
Next i0
Return
' Calculate Simple Magic Cubes
2800
a(181) = b1(19) + 27 * c(181): a(182) = b1(19) + 27 * c(182): a(183) = b1(20) + 27 * c(183):
a(187) = b1(19) + 27 * c(187): a(188) = b1(19) + 27 * c(188): a(189) = b1(20) + 27 * c(189):
a(193) = b1(22) + 27 * c(193): a(194) = b1(22) + 27 * c(194): a(195) = b1(23) + 27 * c(195):
a(199) = b1(22) + 27 * c(199): a(200) = b1(22) + 27 * c(200): a(201) = b1(23) + 27 * c(201):
a(205) = b1(25) + 27 * c(205): a(206) = b1(25) + 27 * c(206): a(207) = b1(26) + 27 * c(207):
a(211) = b1(25) + 27 * c(211): a(212) = b1(25) + 27 * c(212): a(213) = b1(26) + 27 * c(213):
a(184) = b1(20) + 27 * c(184): a(185) = b1(21) + 27 * c(185): a(186) = b1(21) + 27 * c(186):
a(190) = b1(20) + 27 * c(190): a(191) = b1(21) + 27 * c(191): a(192) = b1(21) + 27 * c(192):
a(196) = b1(23) + 27 * c(196): a(197) = b1(24) + 27 * c(197): a(198) = b1(24) + 27 * c(198):
a(202) = b1(23) + 27 * c(202): a(203) = b1(24) + 27 * c(203): a(204) = b1(24) + 27 * c(204):
a(208) = b1(26) + 27 * c(208): a(209) = b1(27) + 27 * c(209): a(210) = b1(27) + 27 * c(210):
a(214) = b1(26) + 27 * c(214): a(215) = b1(27) + 27 * c(215): a(216) = b1(27) + 27 * c(216):
a(145) = b1(19) + 27 * c(145): a(146) = b1(19) + 27 * c(146): a(147) = b1(20) + 27 * c(147):
a(151) = b1(19) + 27 * c(151): a(152) = b1(19) + 27 * c(152): a(153) = b1(20) + 27 * c(153):
a(157) = b1(22) + 27 * c(157): a(158) = b1(22) + 27 * c(158): a(159) = b1(23) + 27 * c(159):
a(163) = b1(22) + 27 * c(163): a(164) = b1(22) + 27 * c(164): a(165) = b1(23) + 27 * c(165):
a(169) = b1(25) + 27 * c(169): a(170) = b1(25) + 27 * c(170): a(171) = b1(26) + 27 * c(171):
a(175) = b1(25) + 27 * c(175): a(176) = b1(25) + 27 * c(176): a(177) = b1(26) + 27 * c(177):
a(148) = b1(20) + 27 * c(148): a(149) = b1(21) + 27 * c(149): a(150) = b1(21) + 27 * c(150):
a(154) = b1(20) + 27 * c(154): a(155) = b1(21) + 27 * c(155): a(156) = b1(21) + 27 * c(156):
a(160) = b1(23) + 27 * c(160): a(161) = b1(24) + 27 * c(161): a(162) = b1(24) + 27 * c(162):
a(166) = b1(23) + 27 * c(166): a(167) = b1(24) + 27 * c(167): a(168) = b1(24) + 27 * c(168):
a(172) = b1(26) + 27 * c(172): a(173) = b1(27) + 27 * c(173): a(174) = b1(27) + 27 * c(174):
a(178) = b1(26) + 27 * c(178): a(179) = b1(27) + 27 * c(179): a(180) = b1(27) + 27 * c(180):
a(109) = b1(10) + 27 * c(109): a(110) = b1(10) + 27 * c(110): a(111) = b1(11) + 27 * c(111):
a(115) = b1(10) + 27 * c(115): a(116) = b1(10) + 27 * c(116): a(117) = b1(11) + 27 * c(117):
a(121) = b1(13) + 27 * c(121): a(122) = b1(13) + 27 * c(122): a(123) = b1(14) + 27 * c(123):
a(127) = b1(13) + 27 * c(127): a(128) = b1(13) + 27 * c(128): a(129) = b1(14) + 27 * c(129):
a(133) = b1(16) + 27 * c(133): a(134) = b1(16) + 27 * c(134): a(135) = b1(17) + 27 * c(135):
a(139) = b1(16) + 27 * c(139): a(140) = b1(16) + 27 * c(140): a(141) = b1(17) + 27 * c(141):
a(112) = b1(11) + 27 * c(112): a(113) = b1(12) + 27 * c(113): a(114) = b1(12) + 27 * c(114):
a(118) = b1(11) + 27 * c(118): a(119) = b1(12) + 27 * c(119): a(120) = b1(12) + 27 * c(120):
a(124) = b1(14) + 27 * c(124): a(125) = b1(15) + 27 * c(125): a(126) = b1(15) + 27 * c(126):
a(130) = b1(14) + 27 * c(130): a(131) = b1(15) + 27 * c(131): a(132) = b1(15) + 27 * c(132):
a(136) = b1(17) + 27 * c(136): a(137) = b1(18) + 27 * c(137): a(138) = b1(18) + 27 * c(138):
a(142) = b1(17) + 27 * c(142): a(143) = b1(18) + 27 * c(143): a(144) = b1(18) + 27 * c(144):
a(73) = b1(10) + 27 * c(73): a(74) = b1(10) + 27 * c(74): a(75) = b1(11) + 27 * c(75):
a(79) = b1(10) + 27 * c(79): a(80) = b1(10) + 27 * c(80): a(81) = b1(11) + 27 * c(81):
a(85) = b1(13) + 27 * c(85): a(86) = b1(13) + 27 * c(86): a(87) = b1(14) + 27 * c(87):
a(91) = b1(13) + 27 * c(91): a(92) = b1(13) + 27 * c(92): a(93) = b1(14) + 27 * c(93):
a(97) = b1(16) + 27 * c(97): a(98) = b1(16) + 27 * c(98): a(99) = b1(17) + 27 * c(99):
a(103) = b1(16) + 27 * c(103): a(104) = b1(16) + 27 * c(104): a(105) = b1(17) + 27 * c(105):
a(76) = b1(11) + 27 * c(76): a(77) = b1(12) + 27 * c(77): a(78) = b1(12) + 27 * c(78):
a(82) = b1(11) + 27 * c(82): a(83) = b1(12) + 27 * c(83): a(84) = b1(12) + 27 * c(84):
a(88) = b1(14) + 27 * c(88): a(89) = b1(15) + 27 * c(89): a(90) = b1(15) + 27 * c(90):
a(94) = b1(14) + 27 * c(94): a(95) = b1(15) + 27 * c(95): a(96) = b1(15) + 27 * c(96):
a(100) = b1(17) + 27 * c(100): a(101) = b1(18) + 27 * c(101): a(102) = b1(18) + 27 * c(102):
a(106) = b1(17) + 27 * c(106): a(107) = b1(18) + 27 * c(107): a(108) = b1(18) + 27 * c(108):
a(37) = b1(1) + 27 * c(37): a(38) = b1(1) + 27 * c(38): a(39) = b1(2) + 27 * c(39):
a(43) = b1(1) + 27 * c(43): a(44) = b1(1) + 27 * c(44): a(45) = b1(2) + 27 * c(45):
a(49) = b1(4) + 27 * c(49): a(50) = b1(4) + 27 * c(50): a(51) = b1(5) + 27 * c(51):
a(55) = b1(4) + 27 * c(55): a(56) = b1(4) + 27 * c(56): a(57) = b1(5) + 27 * c(57):
a(61) = b1(7) + 27 * c(61): a(62) = b1(7) + 27 * c(62): a(63) = b1(8) + 27 * c(63):
a(67) = b1(7) + 27 * c(67): a(68) = b1(7) + 27 * c(68): a(69) = b1(8) + 27 * c(69):
a(40) = b1(2) + 27 * c(40): a(41) = b1(3) + 27 * c(41): a(42) = b1(3) + 27 * c(42):
a(46) = b1(2) + 27 * c(46): a(47) = b1(3) + 27 * c(47): a(48) = b1(3) + 27 * c(48):
a(52) = b1(5) + 27 * c(52): a(53) = b1(6) + 27 * c(53): a(54) = b1(6) + 27 * c(54):
a(58) = b1(5) + 27 * c(58): a(59) = b1(6) + 27 * c(59): a(60) = b1(6) + 27 * c(60):
a(64) = b1(8) + 27 * c(64): a(65) = b1(9) + 27 * c(65): a(66) = b1(9) + 27 * c(66):
a(70) = b1(8) + 27 * c(70): a(71) = b1(9) + 27 * c(71): a(72) = b1(9) + 27 * c(72):
a(1) = b1(1) + 27 * c(1): a(2) = b1(1) + 27 * c(2): a(3) = b1(2) + 27 * c(3):
a(7) = b1(1) + 27 * c(7): a(8) = b1(1) + 27 * c(8): a(9) = b1(2) + 27 * c(9):
a(13) = b1(4) + 27 * c(13): a(14) = b1(4) + 27 * c(14): a(15) = b1(5) + 27 * c(15):
a(19) = b1(4) + 27 * c(19): a(20) = b1(4) + 27 * c(20): a(21) = b1(5) + 27 * c(21):
a(25) = b1(7) + 27 * c(25): a(26) = b1(7) + 27 * c(26): a(27) = b1(8) + 27 * c(27):
a(31) = b1(7) + 27 * c(31): a(32) = b1(7) + 27 * c(32): a(33) = b1(8) + 27 * c(33):
a(4) = b1(2) + 27 * c(4): a(5) = b1(3) + 27 * c(5): a(6) = b1(3) + 27 * c(6):
a(10) = b1(2) + 27 * c(10): a(11) = b1(3) + 27 * c(11): a(12) = b1(3) + 27 * c(12):
a(16) = b1(5) + 27 * c(16): a(17) = b1(6) + 27 * c(17): a(18) = b1(6) + 27 * c(18):
a(22) = b1(5) + 27 * c(22): a(23) = b1(6) + 27 * c(23): a(24) = b1(6) + 27 * c(24):
a(28) = b1(8) + 27 * c(28): a(29) = b1(9) + 27 * c(29): a(30) = b1(9) + 27 * c(30):
a(34) = b1(8) + 27 * c(34): a(35) = b1(9) + 27 * c(35): a(36) = b1(9) + 27 * c(36):
Return
' Check Identical Numbers (Back Check)
2850 fl1 = 1
For i1 = 1 To 216
a20 = a(i1)
For i2 = i1 + 1 To 216
If a20 = a(i2) Then fl1 = 0: Return
Next i2
Next i1
Return
End Sub