OFFSET
1,3
COMMENTS
Similar to A214526, but three-dimensional, and the core is 2 X 2 X 2 rather than 1 X 1.
The spiral begins as follows:
Level z=-2:
95 94 93 92 91 90
96 77 76 75 74 89
97 78 67 66 73 88
98 79 68 65 72 87
99 80 69 70 71 86
100 81 82 83 84 85
z=-1:
116 115 114 113 112 111
117 52 51 50 49 110
118 53 62 61 60 109
119 54 63 64 59 108
120 55 56 57 58 107
101 102 103 104 105 106
z=0:
137 136 135 134 133 132
138 39 38 37 48 131
139 40 3 2 47 130
140 41 4 1 46 129
121 42 43 44 45 128
122 123 124 125 126 127
z=1:
144 145 146 147 148 149
143 34 35 36 25 150
142 33 6 7 26 151
141 32 5 8 27 152
160 31 30 29 28 153
159 158 157 156 155 154
z=2:
165 166 167 168 169 170
164 21 22 23 24 171
163 20 11 12 13 172
162 19 10 9 14 173
161 18 17 16 15 174
180 179 178 177 176 175
z=3:
186 187 188 189 190 191
185 204 205 206 207 192
184 203 214 215 208 193
183 202 213 216 209 194
182 201 212 211 210 195
181 200 199 198 197 196
Algorithm sketch:
1. At every x-y plane the direction is clockwise if z > 0 and counterclockwise if z <= 0.
2. After an N*N cube is complete and we start building an M*M cube, M=N+2:
2a. The spiral at the first new edge of the M*M cube progresses from center to edges, in the same way as the A214526 spiral, e.g., z=-2 in the illustration.
2b. Between the first and last z-edges the spiral progresses according to item 1.
2c. The spiral at the last new edge of the M*M cube progresses from edges to center, e.g., z=3 in the illustration.
FORMULA
abs( a(n) - a(n-1) ) = 1.
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Oct 05 2016
STATUS
approved