Spiral Artefact

What’s the next number in this sequence of integers?


5, 14, 19, 23, 28, 32, 37, 41, 46, 50, 55... (A227793 at the OEIS)

It shouldn’t be hard to work out that it’s 64 — the sum-of-digits of n is divisible by 5, i.e., digsum(n) mod 5 = 0. Now try summing the numbers in that sequence:


5 + 14 = 19
19 + 19 = 38
38 + 23 = 61
61 + 28 = 89
89 + 32 = 121
121 + 37 = 158
158 + 41 = 199
199 + 46 = 245
[...]

Here are the cumulative sums as another sequence:


5, 19, 38, 61, 89, 121, 158, 199, 245, 295, 350, 414, 483, 556, 634, 716, 803, 894, 990, 1094, 1203, 1316, 1434, 1556, 1683, 1814, 1950, 2090, 2235, 2389, 2548, 2711, 2879, 3051, 3228, 3409, 3595, 3785, 3980, 4183, 4391, 4603, 4820, 5041, 5267, 5497, 5732, 5976, 6225...

And there’s that cumulative-sum sequence represented as a spiral:

Spiral for cumulative sum of n where digsum(n) mod 5 = 0


You can see how the spiral is created by following 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E… from the center:


ZYXWVU
GFEDCT
H432BS
I501AR
J6789Q
KLMNOP

What about other values for the cumulative sums of digsum(n) mod m = 0? Here’s m = 2,3,4,5,6,7:

Spiral for cumulative sum of n where digsum(n) mod 2 = 0
s1 = 2, 4, 6, 8, 11, 13, 15, 17, 19, 20, 22…
s2 = 2, 6, 12, 20, 31, 44, 59, 76, 95, 115… (cumulative sum of s1)


sum of digsum(n) mod 3 = 0
s1 = 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33…
s2 = 3, 9, 18, 30, 45, 63, 84, 108, 135, 165…


sum of digsum(n) mod 4 = 0
s1 = 4, 8, 13, 17, 22, 26, 31, 35, 39, 40, 44…
s2 = 4, 12, 25, 42, 64, 90, 121, 156, 195, 235…


sum of digsum(n) mod 5 = 0
s1 = 5, 14, 19, 23, 28, 32, 37, 41, 46, 50, 55…
s2 = 5, 19, 38, 61, 89, 121, 158, 199, 245, 295…


sum of digsum(n) mod 6 = 0
s1 = 6, 15, 24, 33, 39, 42, 48, 51, 57, 60, 66…
s2 = 6, 21, 45, 78, 117, 159, 207, 258, 315, 375…


sum of digsum(n) mod 7 = 0
s1 = 7, 16, 25, 34, 43, 52, 59, 61, 68, 70, 77…
s2 = 7, 23, 48, 82, 125, 177, 236, 297, 365, 435…


The spiral for m = 2 is strange, but the spirals are similar after that. Until m = 8, when something strange happens again:

sum of digsum(n) mod 8 = 0
s1 = 8, 17, 26, 35, 44, 53, 62, 71, 79, 80, 88…
s2 = 8, 25, 51, 86, 130, 183, 245, 316, 395, 475…


Then the spirals return to normal for m = 9, 10:

sum of digsum(n) mod 9 = 0
s1 = 9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 99…
s2 = 9, 27, 54, 90, 135, 189, 252, 324, 405, 495…


sum of digsum(n) mod 10 = 0
s1 = 19, 28, 37, 46, 55, 64, 73, 82, 91, 109, 118…
s2 = 19, 47, 84, 130, 185, 249, 322, 404, 495, 604…


Here’s an animated gif of m = 8 at higher and higher resolution:

sum of digsum(n) mod 8 = 0 (animated gif)


You might think this strange behavior is dependant on the base in which the dig-sum is calculated. It isn’t. Here’s an animated gif for other bases in which the mod-8 spiral behaves strangely:

sum of digsum(n) mod 8 = 0 in base b = 5, 6, 7, 9, 11, 12, 13 (animated gif)


But the mod-8 spiral stops behaving strangely when the spiral is like this, as a diamond:


   W
  XIV
 YJ8HU
ZK927GT
LA3016FS
 MB45ER
  NCDQ
   OP

Now the mod-8 spiral looks like this:

sum of digsum(n) mod 8 = 0 (diamond spiral)


But the mod-4 and mod-9 spirals look like this:

sum of digsum(n) mod 4 = 0 (diamond spiral)


sum of digsum(n) mod 9 = 0 (diamond spiral)


You can also construct the spirals as a triangle, like this:


     U
    VCT
   WD2CS
  XE301AR
 YF456789Q
ZGHIJKLMNOP

Here’s the beginning of the mod-5 triangular spiral:

sum of digsum(n) mod 5 = 0 (triangular spiral) (open in new window for full size)


And the beginning of the mod-8 triangular spiral:

sum of digsum(n) mod 8 = 0 (triangular spiral) (open in new window for full size)


The mod-8 spiral is behaving strangely again. So the strangeness is partly an artefact of the way the spirals are constructed.


Post-Performative Post-Scriptum

“Spiral Artefact”, the title of this incendiary intervention, is of course a tip-of-the-hat to core Black-Sabbath track “Spiral Architect”, off core Black-Sabbath album Sabbath Bloody Sabbath, issued in core Black-Sabbath success-period of 1973.

Bent Pent

This is a beautiful and interesting shape, reminiscent of a piece of jewellery:

Pentagons in a ring


I came across it in this tricky little word-puzzle:

Word puzzle using pentagon-ring


Here’s a printable version of the puzzle:

Printable puzzle


Let’s try placing some other regular polygons with s sides around regular polygons with s*2 sides:

Hexagonal ring of triangles


Octagonal ring of squares


Decagonal ring of pentagons


Dodecagonal ring of hexagons


Only regular pentagons fit perfectly, edge-to-edge, around a regular decagon. But all these polygonal-rings can be used to create interesting and beautiful fractals, as I hope to show in a future post.

Performativizing Polyhedra

Τα Στοιχεία του Ευκλείδου, ια΄

κεʹ. Κύβος ἐστὶ σχῆμα στερεὸν ὑπὸ ἓξ τετραγώνων ἴσων περιεχόμενον.
κϛʹ. ᾿Οκτάεδρόν ἐστὶ σχῆμα στερεὸν ὑπὸ ὀκτὼ τριγώνων ἴσων καὶ ἰσοπλεύρων περιεχόμενον.
κζʹ. Εἰκοσάεδρόν ἐστι σχῆμα στερεὸν ὑπὸ εἴκοσι τριγώνων ἴσων καὶ ἰσοπλεύρων περιεχόμενον.
κηʹ. Δωδεκάεδρόν ἐστι σχῆμα στερεὸν ὑπὸ δώδεκα πενταγώνων ἴσων καὶ ἰσοπλεύρων καὶ ἰσογωνίων περιεχόμενον.

Euclid’s Elements, Book 11

25. A cube is a solid figure contained by six equal squares.
26. An octahedron is a solid figure contained by eight equal and equilateral triangles.
27. An icosahedron is a solid figure contained by twenty equal and equilateral triangles.
28. A dodecahedron is a solid figure contained by twelve equal, equilateral, and equiangular pentagons.

Back to Drac’ #2

Boring, dull, staid, stiff, everyday, ordinary, unimaginative, unexceptional, crashingly conventional — the only interesting thing about squares is the number of ways you can say how uninteresting they are. Unlike triangles, which vary endlessly and entertainingly, squares are square in every sense of the word.

And they don’t get any better if you tilt them, as here:

Sub-squares from gray square (with corner-numbers)


Nothing interesting can emerge from that set of squares. Or can it? As I showed in Curvous Energy, it can. Suppose that the gray square is dividing into the colored squares like a kind of amoeba. And suppose that the colored squares divide in their turn. So square divides into sub-squares and sub-squares divide into sub-sub-squares. And so on. And all the squares keep the same relative orientation.

What happens if the gray square divides into sub-squares sq2 and sq9? And then sq2 and sq9 each divide into their own sq2 and sq9? And so on. Something very unsquare-like happens:

Square-split stage #1


Stage #2


Square-split #3


Square-split #4


Square-split #5


Square-split #6


Square-split #7


Square-split #8


Square-split #9


Square-split #10


Square-split #11


Square-split #12


Square-split #13


Square-split #14


Square-split #15


Square-split #16


Square-split (animated)


The square-split creates a beautiful fractal known as a dragon-curve:

Dragon-curve


Dragon-curve (red)


And dragon-curves, at various angles and in various sizes, emerge from every other possible pair of sub-squares:

Lots of dragon-curves


And you get other fractals if you manipulate the sub-squares, so that the corners are rotated or reverse-rotated:

Rotation = 1,2 (sub-square #1 unchanged, in sub-square #2 corner 1 becomes corner 2, 2 → 3, 3 → 4, 4 → 1)


rot = 1,2 (animated)


rot = 1,2 (colored)


rot = 1,5 (in sub-square #2 corner 1 stays the same, 4 → 2, 3 stays the same, 2 → 4)


rot = 1,5 (anim)


rot = 4,7 (sub-square #2 flipped and rotated)


rot = 4,7 (anim)


rot = 4,7 (col)


rot = 4,8


rot = 4,8 (anim)


rot = 4,8 (col)


sub-squares = 2,8; rot = 5,6


sub-squares = 2,8; rot = 5,6 (anim)


sub-squares = 2,8; rot = 5,6 (col)


Another kind of dragon-curve — rot = 3,2


rot = 3,2 (anim)


rot = 3,2 (col)


sub-squares = 4,5; rot = 3,9


sub-squares = 4,5; rot = 3,9 (anim)


sub-squares = 4,5; rot = 3,9 (col)


Elsewhere other-accessible…

Curvous Energy — a first look at dragon-curves
Back to Drac’ — a second look at dragon-curves

Think Inc #2

In a pre-previous post called “Think Inc”, I looked at the fractals created by a point first jumping halfway towards the vertex of a square, then using a set of increments to decide which vertex to jump towards next. For example, if the inc-set was [0, 1, 3], the point would jump next towards the same vertex, v[i]+0, or the vertex immediately clockwise, v[i]+1, or the vertex immediately anti-clockwise, v[i]+3. And it would trace all possible routes using that inc-set. Then I added refinements to the process like giving the point extra jumping-targets half-way along each side.

Here are some more variations on the inc-set theme using two and three extra jumping-targets along each side of the square. First of all, try two extra jumping-targets along each side and a set of three increments:

inc = 0, 1, 6


inc = 0, 2, 6


inc = 0, 2, 8


inc = 0, 3, 6


inc = 0, 3, 9


inc = 0, 4, 8


inc = 0, 5, 6


inc = 0, 5, 7


inc = 1, 6, 11


inc = 2, 6, 10


inc = 3, 6, 9


Now try two extra jumping-targets along each side and a set of four increments:

inc = 0, 1, 6, 11


inc = 0, 2, 8, 10


inc = 0, 3, 7, 9


inc = 0, 4, 8, 10


inc = 0, 5, 6, 7


inc = 0, 5, 7, 8


inc = 1, 6, 7, 9


inc = 1, 4, 6, 11


inc = 1, 5, 7, 11


inc = 2, 4, 8, 10


inc = 3, 5, 7, 9


And finally, three extra jumping-targets along each side and a set of three increments:

inc = 0, 3, 13


inc = 0, 4, 8


inc = 0, 4, 12


inc = 0, 5, 11

inc = 0, 6, 9


inc = 0, 7, 9


Previously Pre-Posted

Think Inc — an earlier look at inc-set fractals

Dime Time

Everyone knows the shapes for one and two dimensions, far fewer know the shapes for three and four dimensions, let alone five, six and seven. And what shapes are those? The shapes that answer this question:

• How many equidistant points are possible in 1d, 2d, 3d, 4d…?

In one dimension it’s obvious that the answer is 2. In other words, you can get only two equidistant points, (a,b), on a straight line. Point a must be as far from point b as point b is from point a. You can’t add a third point, c, such that (a,b,c) are equidistant. Not on a straight line in 1d. But suppose you bend the line into a circle, so that you’re working in two dimensions. It’s easy to place three equidistant points, (a,b,c), on a circle.

equidistant points on a circle

Three equidistant points around a circle forming the vertices of an equilateral triangle


And it’s also easy to see that the three points will form the vertices of an equilateral triangle. Now try adding a fourth point, d. If you place it in the center of the triangle, it will be equidistant from (a,b,c), but it will be nearer to (a,b,c) than they are to each other. So you can have only 2 equidistant points in 1d and 3 equidistant points in 2d.

But what are the co-ordinates of the equidistant points in 1d and 2d? Suppose (a,b) in 1d are given the co-ordinates (0) and (1), so that a is 1 unit distant from b. When you move to 2d and add point c, the co-ordinates for (a,b) become (0,0) and (1,0). They’re still 1 unit distant from each other. But what are the co-ordinates for c? Start by placing c exactly midway between a and b, so that it has the co-ordinates (0.5,0) and is 0.5 units distant from both a and b. Now, if you move c in the first dimension, it will become nearer either to a or b: (0.49,0) or (0.51,0) or (0.48,0) or (0.52,0)…

But if you move c in the second dimension, it will always be equidistant from a and b, because (a,b) stay in the first dimension, as it were, and c moves equally away from both into the second dimension. So where in 2d will c be 1 unit distant from both a and b just as a and b are 1 unit distant from each other in 1d? You can see the answer here:

equilateral_triangle heightHeight of an equilateral triangle


The co-ordinates for c are (0.5,√3/2) or (0.5,0.8660254…), because the second co-ordinate satisfies the Pythagorean equation 1^2 = 0.5^2 + (√3/2)^2 = 0.25 + 0.75. That is, to find the second co-ordinate of c for 2d, you find the answer to √(1 – 0.5^2) = √(1-0.25) = √0.75 = √(3/4) = √3/2 = 0.8660254….

But you can’t add a fourth point, d, in 2d such that (a,b,c,d) are equidistant. So let’s move to 3d for the points (a,b,c,d). Begin with point d in the center of the triangle formed by (a,b,c), where it will have the co-ordinates (0.5,√3/6,0) = (0.5,0.28867513…,0) and will be equidistant from (a,b,c). But d will be nearer to (a,b,c) than they are to each other. However, if you move d in the third dimension, it will be moving equally away from (a,b,c). So where in 3d will d be 1 unit from (a,b,c)? By analogy with 2d, the third co-ordinate for d will satisfy the generalized Pythagorean equation √(1 – 0.5^2 – (√3/6)^2). And √6/3 = √(1 – 0.5^2 – (√3/6)^2) = 0.81649658… So point d will have the co-ordinates (0.5,√3/6,√6/3) = (0.5, 0.288675135…, 0.816496581…).

And the four points (a,b,c,d) will be the vertices of a three-dimensional shape called the tetrahedron:

Rotating tetrahedron

Rotating tetrahedron


But you can’t add a fifth point, e, in 3d such that (a,b,c,d,e) are equidistant. So let’s move to 4d, the fourth dimension, for the points (a,b,c,d,e). Begin with point e in the center of the tetrahedron formed by (a,b,c,d), where it will have the co-ordinates (0.5,√3/6,√6/12,0) = (0.5,0.28867513…, 0.2041241…, 0) and will be equidistant from (a,b,c,d). But e will be nearer to (a,b,c,d) than they are to each other. However, if you move e in the fourth dimension, it will be moving equally away from (a,b,c,e). So where in 4d will e be 1 unit from (a,b,c,d)? By analogy with 2d and 3d, the co-ordinate for 4d will satisfy the equation √(1 – 0.5^2 – (√3/6)^2 – (√6/12)^2). And √10/4 = √(1 – 0.5^2 – (√3/6)^2 – (√6/12)^2) = 0.79056941… So point e will have the co-ordinates (0.5,√3/6,√6/3,√10/4) = (0.5, 0.288675135…, 0.816496581…, 0.79056941…).

And the five points (a,b,c,d,e) will be the vertices of a four-dimensional shape called variously the hyperpyramid, the 5-cell, the pentachoron, the 4-simplex, the pentatope, the pentahedroid and the tetrahedral pyramid. It’s impossible for 3d creatures like human beings (at present) to visualize the hyperpyramid, but we can see its 3d shadow, as it were. And here is the 3d shadow of a rotating hyperpyramid:

Rotating hyperpyramid or 5-cell

Rotating hyperpyramid


N.B. Wikipedia reveals the mathematically beautiful fact that the “simplest set of coordinates [for a hyperpyramid] is: (2,0,0,0), (0,2,0,0), (0,0,2,0), (0,0,0,2), (φ,φ,φ,φ), with edge length 2√2, where φ is the golden ratio.”

So that’s the hyperpyramid, with 5 points in 4d. But you can’t add a sixth point, f, in 4d such that (a,b,c,d,e,f) are equidistant. You have to move to 5d. And it should be clear by now that in any dimension nd, the maximum possible number of equidistant points, p, in that dimension will be p = n+1. And here are the co-ordinates for p in dimensions 1 to 10 (the co-ordinates are given in full for 1d to 4d, then for 5d to 10d only the co-ordinates of the additional point are given):

d1: (0), (1)
d2: (0,0), (1,0), (0.5,0.866025404)
d3: (0,0,0), (1,0,0), (0.5,0.866025404,0), (0.5,0.288675135,0.816496581)
d4: 0.5, 0.288675135, 0.204124145, 0.790569415
d5: 0.5, 0.288675135, 0.204124145, 0.158113883, 0.774596669
d6: 0.5, 0.288675135, 0.204124145, 0.158113883, 0.129099445, 0.763762616
d7: 0.5, 0.288675135, 0.204124145, 0.158113883, 0.129099445, 0.109108945, 0.755928946
d8: 0.5, 0.288675135, 0.204124145, 0.158113883, 0.129099445, 0.109108945, 0.0944911183, 0.75
d9: 0.5, 0.288675135, 0.204124145, 0.158113883, 0.129099445, 0.109108945, 0.0944911183, 0.0833333333, 0.745355992
d10: 0.5, 0.288675135, 0.204124145, 0.158113883, 0.129099445, 0.109108945, 0.0944911183, 0.0833333333, 0.0745355992, 0.741619849

In each dimension d, the final co-ordinate, cd+1, of the additional point satisfies the generalized Pythagorean equation cd+1 = √(1 – c1^2 – c2^2 – … cd^2).


Readers’ advisory: I am not a mathematician and the discussion above cannot be trusted to be free of errors, whether major or minor.

Think Inc

This is a T-square fractal:

T-square fractal


Or you could say it’s a T-square fractal with the scaffolding taken away, because there’s nothing to show how it was made. And how is a T-square fractal made? There are many ways. One of the simplest is to set a point jumping 1/2 of the way towards one or another of the four vertices of a square. If the point is banned from jumping towards the vertex two places clockwise (or counter-clockwise) of the vertex, v[i=1..4], it’s just jumped towards, you get a T-square fractal by recording each spot where the point lands.

You also get a T-square if the point is banned from jumping towards the vertex most distant from the vertex, v[i], it’s just jumped towards. The most distant vertex will always be the diagonally opposite vertex, or the vertex, v[i+2], two places clockwise of v[i]. So those two bans are functionally equivalent.

But what if you don’t talk about bans at all? You can also create a T-square fractal by giving the point three choices of increment, [0,1,3], after it jumps towards v[i]. That is, it can jump towards v[i+0], v[i+1] or v[i+3] (where 3+2 = 5 → 5-4 = 1; 3+3 = 6 → 2; 4+1 = 5 → 1; 4+2 = 6 → 2; 4+3 = 7 → 3). Vertex v[i+0] is the same vertex, v[i+1] is the vertex one place clockwise of v[i], and v[i+3] is the vertex two places clockwise of v[i].

So this method is functionally equivalent to the other two bans. But it’s easier to calculate, because you can take the current vertex, v[i], and immediately calculate-and-use the next vertex, without having to check whether the next vertex is forbidden. In other words, if you want speed, you just have to Think Inc!

Speed becomes important when you add a new jumping-target to each side of the square. Now the point has 8 possible targets to jump towards. If you impose several bans on the next jump, e.g the point can’t jump towards v[i+2], v[i+3], v[i+5], v[i+6] and v[i+7], you will have to check for five forbidden targets. But using the increment-set [0,1,4] you don’t have to check for anything. You just inc-and-go:

inc = 0, 1, 4


Here are more fractals created with the speedy inc-and-go method:

inc = 0, 2, 3


inc = 0, 2, 5


inc = 0, 3, 4


inc = 0, 3, 5


inc = 1, 4, 7


inc = 2, 4, 7


inc = 0, 1, 4, 7


inc = 0, 3, 4, 5


inc = 0, 3, 4, 7


inc = 0, 4, 5, 7


inc = 1, 2, 6, 7


With more incs, there are more possible paths for the jumping point and the fractals become more “solid”:

inc = 0, 1, 2, 4, 5


inc = 0, 1, 2, 6, 7


inc = 0, 1, 3, 5, 7


Now try applying inc-and-go to a pentagon:

inc = 0, 1, 2

(open in new window if blurred)


inc = 0, 2, 3


And add a jumping-target to each side of the pentagon:

inc = 0, 2, 5


inc = 0, 3, 6


inc = 0, 3, 7


inc = 1, 5, 9


inc = 2, 5, 8


inc = 5, 6, 9


And add two jumping-targets to each side of the pentagon:

inc = 0, 1, 7


inc = 0, 2, 12


inc = 0, 3, 11


inc = 0, 3, 12


inc = 0, 4, 11


inc = 0, 5, 9


inc = 0, 5, 10


inc = 2, 7, 13


inc = 2, 11, 13


inc = 3, 11, 13


After the pentagon comes the hexagon:

inc = 0, 1, 2


inc = 0, 1, 5


inc = 0, 3, 4


inc = 0, 3, 5


inc = 1, 3, 5


inc = 2, 3, 4


Add a jumping-target to each side of the hexagon:

inc = 0, 2, 5


inc = 0, 2, 9


inc = 0, 6, 11


inc = 0, 3, 6


inc = 0, 3, 8


inc = 0, 3, 9


inc = 0, 4, 7


inc = 0, 4, 8


inc = 0, 5, 6


inc = 0, 5, 8


inc = 1, 5, 9


inc = 1, 6, 10


inc = 1, 6, 11


inc = 2, 6, 8


inc = 2, 6, 10


inc = 3, 5, 7


inc = 3, 6, 9


inc = 6, 7, 11


Boole(b)an #3

In the posts “Boole(b)an #1″ and “Boole(b)an #2” I looked at fractals created by certain kinds of ban on a point jumping (quasi-)randomly towards the four vertices, v=1..4, of a square. For example, suppose the program has a vertex-history of 2, that is, it remembers two jumps into the past, the previous jump and the pre-previous jump. There are sixteen possible combinations of pre-previous and previous jumps: [1,1], [1,2], 1,3] … [4,2], [4,3], [4,4].

Let’s suppose the program bans 4 of those 16 combinations by reference to the current possible jump. For example, it might ban [0,0]; [0,1]; [0,3]; [2,0]. To see what that means, let’s suppose the program has to decide at some point whether or not to jump towards v=3. It will check whether the combination of pre-previous and previous jumps was [3+0,3+0] = [3,3] or [3+0,3+1] = [3,4] or [3+0,3+3] = [3,2] or [3+2,3+0] = [1,3] (when the sum > 4, v = sum-4). If the previous combination is one of those pairs, it bans the jump towards v=3 and chooses another vertex; otherwise, it jumps towards v=3 and updates the vertex-history. This is the fractal that appears when those bans are used:

ban = [0,0]; [0,1]; [0,3]; [2,0]


And here are more fractals using a vertex-history of 2 and a ban on 4 of 16 possible combinations of pre-previous and previous jump:

ban = [0,0]; [0,1]; [0,3]; [2,2]


ban = [0,0]; [0,2]; [1,0]; [3,0]


ban = [0,0]; [0,2]; [1,1]; [3,3]


ban = [0,0]; [0,2]; [1,3]; [3,1]


ban = [0,0]; [1,0]; [2,2]; [3,0]


ban = [0,0]; [1,1]; [1,2]; [3,2]

Continue reading “Boole(b)an #3”…


Elsewhere other-engageable

Boole(b)an #1
Boole(b)an #2