Cipher 38: 60 percent wordsearch
De Bruijn sequences
Given a finite alphabet Σ of size s and an integer n, a de Bruijn sequence is a cyclic string of symbols, such that each n-symbol string over Σ appears exactly once. For example, taking Σ to be an alphabet of four colours and choosing n = 3 gives the following de Bruijn sequence of length 64:
It is, quite obviously, the shortest (oriented) loop that contains all possible strings of length 3 over an alphabet of 4 symbols. If we take the alphabet to be the four nucleotide bases of DNA, then this loop of 64 base pairs has the following interesting property: it contains all 64 possible DNA codons.
If one were to actually realise this loop of DNA and effect the process of transcription, then a continual periodic string of RNA would be produced, forming at a site which constantly circumnavigates the DNA loop. Due to the serendipity of 3 and 64 being coprime, this would be translated into a period-64 sequence of all possible amino acids.
Another application of de Bruijn sequences is attempting to break into an electronic safe, which opens when the last four digits pressed matches a particular passcode. The naïve approach of trying each passcode in lexicographical order involves 40000 key presses:
00000001000200030004 [...] 99959996999799989999
Much more efficient is the use of a de Bruijn sequence, which (when the first three digits are re-appended to the end to produce a linear, rather than cyclic, string) is only 10003 digits long.
It can be shown that de Bruijn sequences exist for any ordered pair (s, n), and that the number of such sequences is . Even more impressive is that the concept generalises to de Bruijn tori, which are known to exist in the square case. For example, here is a
torus with 2 colours and every possible
block as a subregion:
Permutations instead of tuples
Nathaniel Johnston considers a similar problem, where the shortest linear string containing all permutations of {1, 2, …, n} is desired. Optimal solutions are known for , but larger cases are beyond the capabilities of brute-force exhaustive search.
The analogous problem to the electronic safe-cracking is a situation in which a monk has to ring every permutation of six monastery bells. The usual approach is to perform each permutation in succession by use of the Steinhaus-Johnson-Trotter algorithm. However, this particular monk is very lazy, so decides to employ the suspected optimal solution to reduce his workload from 4320 bells to just 873 (see Sloane’s A180632).

Seven-dimensional cross product
In three dimensions, the familiar cross product is a bilinear function expressible in terms of the Levi-Civita alternating tensor. Specifically, a = b × c can be written as ai = εijk bj ck, which has the following beautiful properties:
- Bilinearity: a is a linear function of b (when c is fixed), and a linear function of c (when b is fixed);
- Complete antisymmetry: swapping any two of the indices flips the sign of the tensor;
- Orthogonality: a is always perpendicular to b and c;
- Isotropy: the tensor is unchanged when transformed in SO(3).
It should be evident that for orthogonality and isotropy, the cross product can only be defined in three dimensions. In two dimensions or lower, there are insufficiently many dimensions for orthogonality. On the other hand, in four or more dimensions, we can apply a rotation that preserves b and c whilst changing a, so the cross product cannot be well defined. Hence, it only exists in three dimensions (unless it is identically zero, which is stupid and trivial).
However, if we relax the condition of total isotropy, there exists a seven-dimensional analogue of the cross product. It is uniquely determined (up to automorphism of the underlying vector space) by the following conditions:
- Bilinearity;
- Complete antisymmetry;
- Orthogonality.
Even though it doesn’t have full isotropy (i.e. the automorphism group of the tensor is smaller than SO(7)), it still retains a lot of symmetry. The automorphism group is the compact real form of the exceptional Lie group G2.
If we choose the canonical coordinate system, then the components of the tensor can be visualised as a three-dimensional array (where blue and red are +1 and −1, respectively):
The projection shown above highlights the antisymmetry of the tensor — reflecting in an axis causes the colours of the entries to alternate. Note that the position (x, y, z) is non-zero if and only if x, y and z are collinear on (a particular labelling of) the Fano plane.
Quaternions and octonions
With a slight abuse of notation, one can write a quaternion as a sum of a scalar and vector, such as λ + a, where λ is the real part and a is the (three-dimensional) imaginary part. Then, the rule for multiplying quaternions becomes:
- (λ + a)*(μ + b) = (λμ − a · b) + (λb + μa + a × b)
In fact, if we define the one-dimensional cross product to be identically zero, then this is also the definition of multiplying complex numbers. Using a seven-dimensional cross product, we obtain the rule for multiplying weird eight-dimensional entities called octonions. Whilst quaternions are slightly bad (they’re not commutative), octonions are really bad (they’re non-associative, which means you need to use parentheses in products of three or more octonions)!
There’s a book by John Conway and Derek Smith about quaternions and octonions. Rather informatively, it’s entitled On Quaternions and Octonions.
Split octonions
The (squared) norm of an octonion is defined to be the sum of the squares of its components, just as one would define the norm of a complex number. Equivalently, we can consider it to be the length of an octonion as a vector in eight-dimensional space.
It transpires that the octonions have a more pathological cousin, the split octonions, where four of the coordinates are spacelike and the other four are timelike. In other words, they live in a (4+4)-dimensional Minkowski space. When the (seven-dimensional) subspace of purely imaginary octonions is projectivised (the origin is thrown away and real scalar multiples are associated), we get a beautiful six-dimensional projective space. John Baez and Huerta discovered that this is precisely the space of positions of a spinorial ball rolling on the surface of a projective ball of three times its diameter.
Moreover, lines in this six-dimensional space are defined in a natural way, both in terms of the octonionic representation (as subplanes where all products have a norm of zero) and in terms of the rolling balls (as geodesic trajectories where the smaller ball rolls along a great circle of the larger ball).
And the symmetry group of this six-dimensional projective space? The split form of G2, naturally…

Fair dice
(I’m testing out the functionality of the cp4space Facebook page. Hopefully, this post should be automatically published there.)
In most familiar board games, cubic dice are used on the basis that each face is equally likely to face upwards. In prehistoric times, tetrahedral bones were used, and other polyhedral dice are prevalent nowadays. It is not too difficult to see that all regular, and indeed all face-transitive, dice are all trivially unbiased.
What about dice which are not face-transitive? Brent Meeker gave a non-constructive example of such a die. Consider an equilateral triangular prism. By choosing the proportions, it is possible to make the triangular faces more likely than the rectangular faces, or vice-versa.
By the Intermediate Value Theorem, we can find some optimal ratio that gives all faces a probability of 1/5. However, this ratio is dependent on the physical model. We’ll consider two plausible physical models here, and show that each of them give a different optimal proportion.
- The LGS model: We have a large vat of Lyle’s Golden Syrup, into which we drop the die vertically. In this model, the fluid is sufficiently viscous that the inertia of the falling die can be ignored. Specifically, the die falls vertically until a vertex touches the base of the vat. Then, gravity causes the die to roll onto the face directly below the centroid. The probability of a face is proportional to the solid angle subtended by the face from the centroid if the projection of the centroid lands inside the face, and zero otherwise.
- The agitated adhesive model: The die rests on the surface of a steel drum, which is covered in glue. Every second, the drum is hit by a long metal baton, causing the die to spontaneously jump into the air. Each time it lands, there is a probability (an increasing function f, proportional to the kth power of the contact area) of the die permanently sticking to the surface of the drum. As k tends to infinity, a fair die must have all faces with equal area.
With a little help from RIES, I was able to determine that the ratio of edge lengths for a fair die in the LGS model is , compared with
in the limit of the agitated adhesive model.
Pseudo-deltoidal icositetrahedron
The closest thing to a uniform polyhedron without being itself uniform is one of the Johnson solids, the elongated square gyrobicupola. Its projective dual is thus almost face-transitive without actually being face-transitive. It’s a fair die in both of the models shown above, as well as absolutely any other physical model I can imagine. It has the following properties:
- All faces are congruent;
- The incentre and centroid are well-defined and coincide;
- The inertia tensor is isotropic.
A rotating model of the pseudo-deltoidal icositetrahedron is below:
Does there exist a natural physical model in which the pseudo-deltoidal icositetrahedron is not a fair die? In particular, is this the case for the simple Newtonian model?

Cipher 39: Unknown location
Kaleidoscopes
For the third time on cp4space, I’m going to refer to my Wythoffian polyhedron generator. This constructs a polyhedron by the use of some two-dimensional fundamental region, bounded by mirrors meeting at predetermined angles. For example, a triangle with internal angles of π/2, π/3 and π/5 generates polyhedra with icosahedral symmetry:
Now, we can compute the Euler characteristic of a fundamental region, and use this to determine the number of copies of the fundamental region necessary to tile a surface of a particular genus. For instance, when the fundamental region is a triangle with internal angles of π/p, π/q and π/r, the Euler characteristic of the region is:
More generally, for an arbitrary polygon, we have:
- V is the sum of interior angles divided by 2π;
- E is half of the number of edges;
- F = 1.
In the icosahedral case, we have , so we need 120 copies of the fundamental region to tile this sphere (which has an Euler characteristic of 2). Instantly, we can determine from a polygonal kaleidoscope whether it generates an elliptic, flat or hyperbolic tessellation, and determine how many times it covers the region.
Let’s try another one, namely the hyperbolic triangle with interior angles of π/2, π/3 and π/7. This gives an Euler characteristic of . It can tile a three-holed torus (Euler characteristic −4) with 336 copies, arranged in a nice structure with automorphism group PGL(2,7).
What about using squares to tile a torus? This ends up being indeterminate, since the Euler characteristic of the torus and the square are both 0. The same applies to tiling a Klein bottle with hexagons, or a Euclidean plane with triangles.
More complicated kaleidoscopes
To describe groups generated by reflections in higher dimensions, one generally uses a Coxeter-Dynkin diagram. I’ve briefly discussed these before, so I’ll not reintroduce these remarkable objects. Instead, we shall concentrate on simply-laced Dynkin diagrams (all edges are unlabelled) that are simply-connected and have at most one vertex with degree greater than two. For example, the E8 diagram has branches of length 2, 3 and 5:
These are analogous to the 2, 3 and 5 in the dodecahedral symmetry group, and the analogy is related to the McKay correspondence. It’s also mentioned here, although we’ll approach it with slightly more generality. We associate a Dynkin diagram with one multivalent vertex with a polygon, whose internal angles are given by π/l, where l is the length of the branch. Hence, the D4 affine diagram corresponds to a rectangular fundamental region:
It’s also well defined, since measuring angles of π on the edges of the polygon corresponds to branches of length 1 (the central node in the diagram). The thing that really makes this connection natural is the following:
- The Dynkin diagram is finite/affine/hyperbolic precisely when the surface generated by the two-dimensional kaleidoscope is spherical/flat/hyperbolic, respectively.
So, the rectangular kaleidoscope *2222 (in Thurston’s orbifold notation) corresponds to the D4 lattice, and they both generate flat tilings. Other correspondences are below:
Spherical:
- Dihedral symmetry *22n ↔ D(n+2)
- Tetrahedral symmetry *332 ↔ E6
- Octahedral symmetry *432 ↔ E7
- Icosahedral symmetry *532 ↔ E8
Flat:
- *2222 ↔ affine D4
- *333 ↔ affine E6
- Square tiling symmetry *442 ↔ affine E7
- Hexagonal honeycomb symmetry *632 ↔ affine E8
Hyperbolic:
- *732 ↔ hyperbolic E9 lattice
- *666 ↔ hyperbolic Coxeter group containing the bimonster as a quotient
Unfortunately, I can’t see how this would generalise to the affine Dn diagram (for n >= 5), since the diagram has two vertices of degree 3. Similarly, this doesn’t work particularly well for the regular An diagram, which is just a straight line:
- A7 = 4—3—2—1—2—3—4
So, according to our correspondence, this gives this hosohedron:
Now, there is a certain ambiguity in the construction. For example, what if we had labelled A7 using an off-centre root node?
- A7 = 5—4—3—2—1—2—3
This would correspond to a digonal fundamental region with angles of π/3 and π/5, which just doesn’t work properly. Hence, we had no choice but to choose the centre node. A more awkward repercussion is that this is only possible for odd n. For example, the hosohedra for A3 and A5 are shown below, but the construction fails for A4.
Well, that is at least suggestive of what A4 should correspond to: a hosohedron with five lunes, alternately coloured. When one attempts to construct it, serious difficulties are encountered. However, we can avoid those complications by using the double cover of the spherical symmetry group, in which case we recover the original McKay correspondence.
We can also make sense of some infinite Coxeter diagrams. For example, the E∞ diagram (limit of En for all n, which gives an infinitely-generated Coxeter group) below corresponds to the *23∞ symmetry group (isomorphic to the modular group PGL(2,Z)):
I don’t think that this analogy between Dynkin diagrams and two-dimensional kaleidoscopes is anything other than a convenient mathematical coincidence, although it seems to be intimately related to the McKay correspondence.

Symmetric geometry theorems
Clark Kimberling’s Encyclopedia of Triangle Centres contains several thousand triangle centres, many of which are defined as intersections of three concurrent lines. For example, we have:
- The three medians of a triangle intersect at the centroid;
- The three altitudes of a triangle intersect at the orthocentre;
- The three angle bisectors of a triangle intersect at the incentre;
- The three perpendicular bisectors intersect at the circumcentre.
Indeed, it was joked that any symmetrically defined lines concur, the result being proclaimed the `symmetric geometry theorem’. Unfortunately, this is actually false, as shown by James Aaronson’s example of `the angular bisector of the median and the altitude’:
Hence, we don’t get a new triangle centre in this way.
Actual theorems
Nevertheless, there are many geometrical theorems with a large amount of symmetry, which we’ll refer to as `symmetric geometry theorems’. For instance, the configuration of Desargues’ theorem has 240 symmetries (isomorphic to S5 × C2) if you include projective duality. Similarly, Miquel’s six-circle theorem has 48 symmetries, which is evident by having the incidence structure of a cube:
Conway’s Petersen graph theorem
What was most interesting, however, was the following excerpt from an e-mail by John Conway, dated October 2003:
1. If two [sic] each vertex of the Petersen graph one assigns a line in 3-space, in such a way that all but one of the edges correspond to pairs of lines that intersect at right angles, then so does the last edge.
This seems quite remarkable. Ten lines give 40 real variables, and there are 28 linear constraints; this corresponds to 12 degrees of freedom. Also, note that if we replace ‘intersect at right angles’ with just ‘have perpendicular directions’, then the theorem must also hold: we can reduce it to the original situation by translating all lines so that they pass through the origin.
I tried to construct an example with lots of symmetry. A solution to the problem automatically induces a solution where the lines pass through the origin, so my first thought was to try the ten diameters passing through opposite vertices of a dodecahedron. Remarkably, this does have a Petersen graph incidence structure, but only when ‘at right angles’ is replaced with ‘at some other angle that I can’t be bothered to calculate’. Unfortunately, it doesn’t satisfy the original theorem, so any actual solution must have significantly lower symmetry than the Petersen graph itself.
Anyway, I found a single reference to this on a Math Overflow question, also from John Conway:
An equivalent version is the following: suppose you have a “right-angled hexagon” in 3-space, that is, six lines that cyclically meet at right angles. Suppose that they are otherwise in fairly generic position, e.g., opposite edges of the hexagon are skew lines. Then take these three pairs of opposite edges and draw their common perpendiculars (this is unique for skew lines). These three lines have a common perpendicular themselves.
The other examples on the page are purely projective theorems. Pappus’ theorem, Desargues’ theorem and Penrose’s ‘conic cube’ theorem are all self-dual, by the way. Here’s one of mine that isn’t self-dual, derivable from the quartic version of Cayley-Bacharach:
- Graph: rhombic dodecahedron;
- Vertices: six vertices are conics; the other eight are pairs of points;
- Edges: incidence;
- Statement: if five of the conics are present, then so is the remaining one.
It’s a grand generalisation of Miquel’s six circle theorem, with conics instead of circles and pairs of points instead of individual points.

Cipher 40: Leversha’s paradise
Occasionally, mathematical olympiads contain no classical Euclidean geometry. One such example is the IMO paper in the action thriller X+Y, which encompasses discrete combinatorics, additive combinatorics and algebra. To compensate for this, I have designed a cipher based entirely on Euclidean plane geometry.
As usual, there is a solvers’ area protected by a password contained within the cipher.

Polynomials and Hamming weights
Let P(x) be a polynomial of degree n. Let H(i) represent the number of `1′s in the binary expansion of the integer i. Although reasonably easy to prove, it may seem surprising that the following identity holds:
Does this theorem have a name? I discovered a variation of it years ago when solving a problem given to me by James Aaronson, and applied it again this weekend to reduce an infinite problem to a finite one. One nice corollary of this theorem is that any arithmetic progression of numbers can be partitioned into two subsets, A and B, such that:
- A and B contain equally many elements;
- The sums of the elements of A and B are equal;
- The sums of squares of elements of A and B are equal;
- (ellipsis)
- The sums of the nth powers of elements of A and B are equal.
By iterative application of this theorem, we can partition an arithmetic progression of numbers into
subsets with this property. This is similar in principle to the idea of a multimagic square, but strictly less impressive.

Analysing Escher
I have just been involved in the production of an action thriller about the International Mathematical Olympiad. Since certain intervals of time were inactive and unthrilling, I decided to pass the time by writing a few cp4space articles, amongst other things. This particular one was distributed across an evening and several train journeys.
Anyway, when I was at the actual IMO a few years ago, the opportunity presented itself to visit the M. C. Escher museum in The Hague. In the process, I acquired five postcards featuring the art of M. C. Escher, which I intend to put to good use in the immediate future. Until then, however, I shall merely analyse them:
Snakes, 1969
This was Escher’s final print, and has always been particularly aesthetically pleasing. However, until now I haven’t analysed it in great detail. Ignoring the snakes themselves, which are intertwined throughout the structure in a strikingly elegant pattern exhibiting three-fold cyclic symmetry, reveals an elaborate chainmail of interlocking annuli.
At first glance, the overall appearance resembles one of Escher’s more familiar Circle Limit engravings, where vibrant mythical creatures tessellate the Poincaré disc model of the hyperbolic plane; I described the process extensively here. However, in addition to the limiting ‘circle at infinity’, there is also a limit point in the centre of the disc. How did Escher manage that? It’s certainly unlike any projection of any Riemann surface I’ve so far encountered.
On further inspection, one can see that something is slightly amiss. Each ring is linked with n others, were n = 6, 7 or 8, depending on the position. By taking the Voronoi partition, we obtain a greatly simplified picture of exactly what is happening in this masterpiece. Colour-coding regions according to the number of neighbours gives an even clearer diagram:
Towards the edge of the disc, the tiling is locally the truncated order-6 square tiling of the hyperbolic plane, where two octagons and one hexagon meet at each vertex. This can be regarded as a hyperbolic variant of the following Euclidean tiling seen on many kitchen floors:
On the other hand, the centre of the tiling induced by Snakes is devoid of octagons, instead being composed entirely of hexagons meeting three at each vertex, as in the hexagonal honeycomb. This is locally flat, and globally has been rolled into a cylinder (also zero curvature). Indeed, it is identical to a perspective view into a carbon nanotube, extending far into the distance.
Symmetry drawing E55, 1942
Preceding Escher’s Circle Limits were analogous tessellations of the Euclidean plane, imaginatively exploiting the admissible symmetry groups of periodic planar tilings (known as wallpaper groups). In this particular watercolour, fish of three different colours are arranged to exhibit the wallpaper group with signature 632, so called because the fundamental region (a single fish, since the symmetry group is sharply fish-transitive) of the tiling has centres of six-fold, three-fold and two-fold rotational symmetry:
This is known as Thurston’s orbifold notation, and heavily popularised in The Symmetries of Things by Conway, Burgiel and Goodman-Strauss. One of the chapters explores how colour can interact with symmetry, and Escher’s tiling is an excellent exemplar for exhibiting this classification. In particular, we consider symmetries to act on the n colours, giving a homomorphism into the symmetric group Sn. The kernel of this homomorphism is simply the normal subgroup of symmetries which preserve each colour. In this case, the kernel has orbifold notation 2222, as we can find four centres of two-fold symmetry preserving all colours.
The parallelogram in the image above is not the fundamental region; it is precisely half of a fundamental region.
Reptiles, 1943
Whereas the previous postcard was a colourful tessellation of fish, this one features a ‘symmetry drawing’ of reptiles (pun intended?) of signature 333, with a colour-preserving kernel of translations.
This still image suggests the following motion: two of the tiles are developing into three-dimensional crocodiles, which embark upon an anticlockwise trek around the lithograph, climbing over a regular dodecahedron in the process. Finally, they dissociate back into the sea of reptiles, losing their three-dimensionality and completing the cycle.
In the bottom-left corner is probably the union of a spherical cactus and an Aloe Vera, but I prefer to interpret it as a decapitated pineapple. The Geometry of the Pineapple (a possible sequel to Sphere Packings, Lattices and Fruits?) certainly merits further discussion.
A loxodrome is a curve drawn on a sphere, originating at the north pole, spiralling outwards so as to intersect the meridians at equal angles, and spiralling back into the south pole. Equivalently, it is obtained by stereographic projection of a logarithmic spiral onto a sphere. If you want to use the word ‘loxodrome’ in general conversation, I find that the easiest way to do so is to peel an orange thusly and participate in the discussion that undoubtedly ensues:
Anyway, from oranges to pineapples: the surface of a pineapple features eight clockwise loxodromes intersecting thirteen anticlockwise loxodromes, positioned at regular intervals. (The directions may be reversed, and (8,13) can be replaced by any pair of consecutive Fibonacci numbers.) As 8 is not equal to 13, a pineapple is chiral; one can have left-handed and right-handed pineapples.
Consequently, John Conway complains when artists frequently draw pineapples with bilateral symmetry, as this does not accurately reflect nature. I cannot determine from the postcard whether Escher has committed the same indiscretion, although I highly doubt it given the overwhelming accuracy of the Poincaré projection in his Circle Limit opus.
Möbius Strip II, 1963
Whilst this behaviour is most popularly exhibited by processionary caterpillars, ants also follow each other to a certain extent. In this woodcut, Escher populates the surface of a Möbius strip with a set of ants. Since the Möbius strip is non-orientable, the ants can see other ants walking on the underside of the surface. With an odd number (in this case, nine) of ants, the ants are directly between their subterranean counterparts; with an even number, equidistant ants form pairs with each ant immediately below its partner. Compare this with star polygons, which are connected if and only if the parameters are coprime.
Whilst reclining on the forbidden grass of our rivals, St. John’s College, a dialogue developed about the one-sided nature of the Möbius strip. Specifically, I was looking through these Escher postcards with Razia*, and explained how to construct a Möbius strip by introducing a half-twist into a strip of paper before connecting the ends. She astutely remarked that the surface of an ordinary sheet of paper is also technically one-sided [since it is a topological sphere].
* This spelling is an unconfirmed estimate, based on the pronunciation (in IPA).
Meanwhile, she mentioned how one of her favourite Escherisms that was absent from my minimal collection of postcards was Drawing Hands, where two hands equipped with pencils draw each other in a paradoxical self-referential way. In the bestseller Gödel, Escher, Bach, Douglas R. Hofstadter used this as the archetypal example of a strange loop. Other examples of strange loops in Escher’s works were Ascending and Descending, along with the beautiful 1961 lithograph featured on the fifth and final postcard, unanimously and undoubtedly our favourite Escherism:
Waterfall, 1961
The centrepiece is a perpetual motion machine of the first kind, exploiting the first law of thermodynamics by allowing a continually-descending stream of water to drive a turbine and return whence it came, completing the cycle. Unfortunately (or perhaps fortunately — a violation of the first law of thermodynamics could cause a major catastrophe), this cannot be used as a source of free energy as it is unrealisable in our three-dimensional world, , due to the presence of Penrose triangles in the design.
The fact that this can be drawn but not built is a consequence of the non-invertibility of the projective transformation used to convert a three-dimensional scene into a two-dimensional photograph. It has a non-trivial kernel, which means that many points (indeed, infinitely many) in the three-dimensional space are mapped to the same point in the photograph, causing a loss of information that can conveniently be exploited to yield impossible drawings.
You may notice that the towers are each decorated with a compound of three polyhedra: cubes in one example; irregular octahedra in the other. If Escher had used regular octahedra instead, the compounds would be perfect projective duals of each other.
Concluding remarks
- In conclusion, the combination of the architectural beauty, mathematical ubiquity and general popularity mean that I shall imminently be sending the Waterfall postcard, as opposed to any of the others. Of course, rather than tell you the intended destination and purpose, I’ll leave it as an exercise for the reader…
- I’ve tried to make this article more accessible and interesting to a general audience. Hence, if you enjoyed reading this you may want to consider sharing this on whatever social networks you inhabit, in case you know others who would also find it interesting. There have been 96884 views of cp4space since the 22nd August 2012, when it was founded, and I hope it will reach 100000 before the anniversary; consequently, any publicity will be gratefully welcomed!

Growth of recursive string substitution
A Lindenmeyer system, or L-system, involves a recursive procedure applied to a string of symbols, where each symbol in the string is simultaneously replaced with a string, dependent on that symbol. For example, one of my favourite examples involves Easter eggs and rabbits, with the following rewrite rules:
"E" --> "R" (Easter egg hatches into a rabbit.) "R" --> "ER" (Rabbit lays an Easter egg.)
Beginning with a single egg, the following growth pattern is observed:
"E" --> "R" --> "ER" --> "RER" --> "ERRER" --> ...
It’s trivial to show that the number of symbols in a particular iteration is given by the Fibonacci sequence. Indeed, for any L-system, we can obtain a recurrence relation for the number of characters, which can then be turned into a closed form involving powers of a particular ‘transition matrix’, which can be converted into an even more closed form by diagonalising the matrix. In this case, the closed form is Binet’s formula:
where φ and ψ are the roots of the equation x² − x − 1 = 0.
Audioactive decay
The lengths of strings produced by an L-system follow a basic linear recurrence relation, so they’re quite easy to calculate. A less obvious growth is that undertaken by Conway’s audioactive decay sequence. This begins with a single ’1′, which is repeatedly run-length encoded:
- 1
- 11
- 21
- 1211
- 111221
- 312211
- …
For example, the third string 111221 contains 3 ’1′s, followed by 2 ’2′s and 1 ’1′, so the next term is 312211. Since adjacent digits can interact, the behaviour is less predictable than that of an L-system. It transpires, however, that after 24 iterations any string will ‘decay’ into a disjoint union of non-interacting ‘elements’, of which there are 92. Treating these elements as individual ‘symbols’, the audioactive decay rule is just a complicated L-system! The dominant eigenvalue is Conway’s constant, the positive real root of a particular degree-71 polynomial:
Doron Zeilberger and his pet computer Shalosh B. Ekhad proved this in their paper on the subject. He mentions how it’s a posteriori trivial, since it takes no effort to write a computer program to verify that strings eventually decay into a meta-L-system, but not a priori trivial — similar rulesets (certain Post-Tag systems) can have no computable closed form, in which case the computer program would run forever and fail to find a proof.
Double-exponential growth and bangbangs
If a character can be replaced with the previous string, we can have double-exponential growth. For instance, the following rules:
X --> $ O --> O
(where $ indicates the entirety of the previous string) applied to the initial string XOX gives the following sequence:
XOX --> XOXOXOX --> XOXOXOXOXOXOXOXOXOXOXOXOXOXOXOX --> ...
where each term has 2^2^n ‘X’s.
Of course, this is not a particularly interesting example, since it just creates alternating strings of one-dimensional noughts and crosses. A far more exciting sequence, sent to me by Volker Grabsch, arises when one experiments with the recursive functionality of Unix/Linux, which has a ‘repeat previous instruction’ command, known as a bangbang and represented by two adjacent exclamation marks.
Shadab Ahmed discovered that the resulting behaviour is quite complicated, since single quotes and double quotes can interchange roles as being string delimiters and string contents, and they have a non-trivial effect on which bangbangs are expressed at any time. Volker Grabsch wrote an algorithm to emulate this process, calculating further terms in the sequence and creating an OEIS entry for the number of bangbangs in the nth iteration. Robin Houston then ingeniously used polynomials with exponents in the symmetric group to contain the information in the strings, yielding a simple recurrence relation and an efficient way to compute further terms.
What’s remarkable is that all of this collaborative research, from initial contemplation of the problem to final recurrence relation, took place just two days ago.
Tetrational growth
In a previous article, I mentioned the finite stages of the von Neumann universe, and wondered how many pairs of braces appear in each stage. It is trivial to see that it each term is an asymptotically exponential function of the previous term, and not too difficult (by considering how many braces an average subset contains) to derive a straightforward recurrence relation.
Interestingly, this was already on the OEIS under a different definition (based on rooted trees). I decided to add the next term to the b-file, even though they don’t generally like 20000-digit entries…

Influential mathematicians
It has come to my attention that there is a maths camp taking place at Balliol College, Oxford, with the intention of subjecting young aspiring mathematicians to new ideas. Since one of the volunteers at the camp is advertising cp4space there, we decided that it would be a good idea to inspire the trainees with randomly selected examples of influential mathematicians:
Hypatia
I’ve decided to adopt a vaguely chronological approach, so we shall begin in Alexandria, a city in Egypt built by the eponymous Alexander the Great. It was the centre of education in the ancient world, and thus could be regarded as a 2000-year-old counterpart of Cambridge. Nevertheless, its library was far more aesthetically pleasing than our UL, and it is absolutely tragic that it no longer exists.
Hypatia was born in the fourth century AD, and eventually became head of the Platonist school of philosophy. She shifted the focus from empirical observation to more rigorous mathematical proof, thus helping to incorporate mathematics into physics. Indeed, one of her many accomplishments was determining the motion of celestial bodies, not unlike how Gauss predicted the trajectory of Ceres in his youth.
Hypatia also developed ideas from Diophantus’ Arithmetica, Euclid’s Elements and Apollonius’ Conics (three very influential mathematical texts from Ancient Greece), amongst others.
Ada Byron
You’ve probably heard of the famous poet Lord Byron, who had a number of interesting eccentricities including keeping a pet bear in the hallowed halls of Trinity College, Cambridge, where it would roam the vast, impressive courtyards and cause something of a stir amongst fellow Trinitarians.
His daughter, Ada Byron, went into a very different discipline, becoming the first computer programmer. She developed an algorithm for computing Bernoulli numbers on the Analytical Engine, the first programmable mechanical computer, which was designed by the Lucasian Professor of Mathematics, Charles Babbage (who also went to Trinity).
Most impressively, however, she realised that the Analytical Engine had a theoretical superiority over Babbage’s earlier Difference Engines and the calculating machines of Pascal and Leibniz, in that it could be programmed to perform functions of arbitrary complexity instead of mere routine calculations. Indeed, this insight could have resulted in Turing-complete computers being built long before Alan Turing.
Unfortunately, since it was mechanical and vastly complicated, the Analytical Engine was not built within Babbage’s lifetime. Indeed, only part of it has been reconstructed, and there is currently an effort to realise it in its entirety.
Ada Byron was also somewhat promiscuous — another attribute with which I can empathise. Indeed, together with my scandalous and outlandish (albeit successful!) expenses claims from the UKMT, some people have suggested respacing my name to form ’Ada M.P. Goucher’…
Sophie Germain
A contemporary of Gauss and Legendre, Sophie Germain originally concealed her identity and used the pseudonym M. LeBlanc. Gauss acknowledged her genius in correspondence with Olbers; hence, she was certainly a mathematician of the highest calibre. Her work on Fermat’s Last Theorem was the first non-trivial progress since Fermat and Euler, and resulted in primes of the form (p − 1)/2 being called Sophie Germain primes.
(For some reason, the factorisation of is named after her, despite being completely trivial.)
Emmy Noether
In our universe, there are many symmetries. For instance, the laws of physics are invariant under translation (homogeneity), rotation (isotropy) and Lorentz transformations (Lorentz invariance). Using the Hamiltonian formulation of mechanics, Emmy Noether was able to show that each of these symmetries gives rise to a conservation law (e.g. conservation of linear momentum, angular momentum and energy).
She also contributed to pure mathematics; a Noetherian ring is one where all ideals are finitely generated. There is an Emmy Noether Society at Cambridge named in her honour, which have hosted talks by mathematicians such as Ruth Gregory. They also gave out free cake in the CMS, which was definitely worth attending.
Vicky Neale
One of the most prolific mathematicians of the 20th century was Paul Erdős. His collaborators and doctoral advisees include many famous mathematicians; for instance, he was the advisor of Professor Béla Bollobás FRS, who was in turn the advisor of Professors Imre Leader and Timothy Gowers, the latter of which advised Professor Ben Green. (They all went to Trinity as well — not that I’m advertising this amazing college, which is far better than Balliol.)
Tragically, Ben Green is no longer with us, but will always be remembered and his legacy shall live on in his students, including Professor Vicky Neale. Vicky Neale, Vesna Kadelberg, the absolutely brilliant IMO team leader James Cranch and I have been heavily involved in the organisation of a competition called the MOG, which some of you will be sitting in September. Good luck, and I hope this cp4space post has inspired you…

Cipher 41: Caesar cipher
Langton’s loops, sexually-transmitted viruses and architecture
What do the Sydney Opera House, the Human Papillomavirus and the following model of artificial life have in common?
The history of artificial life has been a long one, and few would argue that it originated with the Hungarian-American mathematician John von Neumann (whom you may recognise for his research in game theory and axiomatic set theory, development of the atomic bomb and the design of the modern computer). He first proposed a kinematic model, equipped with wheels, motors, joints et cetera, but then moved away from this in favour of his more abstract model of cellular automata.
To win a pint of beer in a pub in 1968, the computer scientist Edgar Codd created a spectacularly simpler self-reproducing cellular automaton, with just eight states (if you’re unfamiliar with cellular automata, think of these as analogous to different types of elementary particles) instead of the twenty-nine states of von Neumann’s model. The size of a self-reproducing machine was still very large, with the only explicit examples being Tim Hutton’s implementation of Codd’s machine and my Bletchley replicator (so called because it completed its first cycle of self-replication on my computer whilst I visited Bletchley Park in 2009).
In the eighties, Christopher Langton had the insight that self-replication could be made much simpler. Langton’s loops, pictured at the top of this article, were loosely based on Codd’s cellular automaton, but about six orders of magnitude smaller. A loop of genetic material circulates anticlockwise, instructing a pseudopodium to extend forward and turn left. The sequence of instructions is repeated four times, completing a copy of the loop which then breaks from its parent, acquiring a copy of the genome. This repeats indefinitely, filling space with a colony of self-reproducing loops:
Human Papillomavirus
One of the many beautiful aspects of Langton’s loop is that the same genome is expressed four times, exploiting the symmetry of the square loop to reduce the length of its representation to a sufficient extent that it fits within the loop. This is precisely reflected in nature by a variety of viruses including the Human Papillomavirus, a common sexually-transmitted infection.
The virus has chiral icosahedral symmetry, which means that its protein coat (or capsid) is composed of sixty congruent copies of the same fundamental region. The papillomavirus actually goes one step further, in that each fundamental region is constructed from an irregular arrangement of six copies of a single protein, called L1. In other words, the protein coat of this virus self-assembles from 360 identical parts. More details about the specific geometry are on ViralZone.
Of course, the virus itself only needs to have instructions for constructing a single copy of the L1 protein, a ‘subroutine’ that is executed 360 times in the construction of the capsid. This means that its genome can be really small compared with the size of the capsid — indeed, small enough to fit within it. In addition to the gene for the L1 protein, the viral genome encodes proteins for DNA replication and for attacking our P53 protein (used for repairing DNA and preventing cancer) to leave our DNA vulnerable to modification.
Modern and classical architecture
One of the most famous examples of modern architecture, the Sydney Opera House was designed and built over a sesquidecade by the architect J∅rn Utzon.

Image courtesy of Kazuhisa Togo.
The roof was originally meant to be composed of parabolae, but the construction costs would have been phenomenal. Utzon’s solution was to instead give all of the roof segments a constant Gaussian curvature, i.e. to make them sections of the same sphere. This meant that, like the Papillomavirus capsid, it could be made from many identical subunits produced in a single mould.
When asked ‘what did the Romans ever do for us?’, one of the many accomplishments was the aqueduct. There was much debate on the math-fun mailing list about why the Romans had semicircular arches, as opposed to the structurally superior parabolae (optimal for supporting large uniform walls) and catenaries (optimal for supporting their own weight). Some people suggested that the consideration was purely aesthetic, although my preferred theory is that it is another case of using many identical subunits:
Indeed, in aqueducts such as the Pont du Gard, the arches themselves form monomers, which are repeated many times along the length of the aqueduct. These are also arranged symmetrically, but with an infinite translational symmetry group instead of the finite rotational symmetry groups observed in Langton’s loops and the Human Papillomavirus. Viruses can also have capsids arranged according to an infinite symmetry group, as in the case of the helical tobacco mosaic virus. Both this structure and the more familiar icosahedral structure were predicted by Watson and Crick, who theorised that viruses must have many identical subunits arranged in a symmetrical fashion.

A year of cp4space
I am proud to announce that Complex Projective 4-Space is celebrating its first anniversary today. This is an excellent opportunity to quantitatively summarise what has happened on cp4space in the last year:
- Complex Projective 4-Space has been viewed 104125 times since its conception, with 3304 of those being on the 18th August (i.e. last Sunday). The United Kingdom topped the list with 43454 views, with America in close second (27746 views). The top 25 countries are displayed below. Hungary is surprisingly low in 25th place, when one considers that it was a discussion in Hungary several years ago that led to the creation of cp4space.
- There have been 41 ciphers and 33 distinct solvers, with a total of 236 ordered pairs of (cipher, person who has solved that cipher). Stuart Gascoigne is currently ahead, with Joseph Myers and Sam Cappleman-Lynes previously controlling that position.
- This is the 200th article. Two of the articles were guest posts by James Cranch and Gabriel Gendler; the remaining 198 were written by me.
- Recently, cp4space acquired a Facebook page as recommended by James Aaronson and Vishal Patil.
To celebrate the anniversary, I have been informed that Maria Holdcroft is making cp4space gingerbread men. I’ll upload photographs thereof as soon as possible.

Gingerbread men
A few days ago, I mentioned how cp4space was being advertised at the Balliol maths camp. What I didn’t realise was that some of the EGMO veterans running sessions at the camp decided to make confectionery to celebrate the cp4space anniversary!
Firstly, we have a generic cp4space gingerbread man by Kasia Warburton:
The text appears to be milk and dark chocolate, toffee/fudge and icing. Maria Holdcroft made 25 more cp4space gingerbread men, in addition to a somewhat mutilated effigy of my nemesis Tom Rychlik and a cookie featuring the greatest emoticon in existence, the infamous ;P.
Natalie Behague immortalised Farida and me in monoliths of gingerbread, also included in the photograph below (in the second row of this triangular array, where Farida and I have a regular star polygon and a P, respectively, emblazoned on our torsi):
With this being a tribute to cp4space, I’m highly suspicious that the 3-tuples over the set {dark chocolate, milk chocolate, toffee/fudge, icing} on the gingerbread men may actually encode a hidden message. However, I’m rather too tired at the moment to attempt any cryptanalysis on this beautiful piece of possible steganography.
According to Maria Holdcroft, ”Farida, being so extremely attractive, was one of the first to be eaten”. My gingerbread counterpart, on the other hand, appears to be undergoing some sort of occult ritualistic sacrifice in the inner sanctum of Balliol:
I have been reliably informed that the coleoptera-adorned fingernails are the opus of Katya Richards.
If you wish to make cp4space gingerbread men (or women) yourself, there are instructions on the official Lyle’s Golden Syrup website. As in the pictures above, it’s considered sufficient to just brand the gingerbread men with ‘CP4′. If you’re an expert in the world of icing application, then you may be able to manage the blackboard bold font, or even (if you’re really ambitious) the cp4space logo, namely a multicoloured stereographic projection of the 120-cell.
Have fun, and send in anything that you produce!

New aperiodic monotile
In three dimensions, an aperiodic monotile is a solid capable of tiling space, but not in such a way that admits translational symmetry. The question of existence of aperiodic monotiles stems from a weaker question, which formed part of Hilbert’s eighteenth problem:
Does there exist a polyhedron capable of tiling space, but not tile-transitively?
The first example of an anisohedral tile was found in 1928 by Karl Reinhardt. An aperiodic monotile would obviously be anisohedral, although it surprisingly took 60 years before Schmitt found the first aperiodic example in 1988.
The purpose of this post is to present a new monotile I discovered a few days ago, and which seems like it could have been discovered much earlier than 1988. I also claim that its structure and proof of aperiodicity are simpler (i.e. easier to reconstruct) than any other aperiodic monotile.
Structure
The aperiodic monotile is essentially a 5 × 5 Lego brick, where the grid of knobbles on the top (but not the complementary indentations on the bottom) have been rotated by the arctangent of ¾. Five such monotiles are shown in the diagram above. Four of the knobbles overhang, although reducing their diameter could overcome that. Similarly, if you prefer polyhedra to arbitrary solids, you can replace the cylindrical knobbles with square prisms.
Its existence stems from the Pythagorean identity 3² + 4² = 5², and this construction should generalise to any primitive Pythagorean triple. Of course, this is the simplest, and therefore the most preferable. Note that in this case, the knobbles on the top are in a centred square arrangement, rather than a square (and that relies on 3 and 4 being consecutive).
Proof
The only result that we’ll use is the fact that the Gaussian integers (complex numbers with integer real and imaginary parts) form a unique factorisation domain. This isn’t any more difficult to prove than the Fundamental Theorem of Arithmetic, which is the equivalent statement over the ordinary integers.
The first part of the proof is to show that the only tilings are the ‘obvious’ ones, where the monotiles form layers, each of which is a square lattice, and each layer is rotated by the arctangent of ¾ with respect to the layer below. Each tile forces tiles to exist above and below it, and rotated by this angle. This produces some overhang, which means that surrounding tiles are forced and (by induction) the entire tiling is arranged in layers.
The next part of the proof shows that no two layers have the same orientation. This is equivalent to showing that the complex number is not a root of unity. Suppose that it is a kth root of unity, in which case we obtain the identity
, which clearly violates unique factorisation. Hence, by a reductio ad absurdum argument, we win.
Consequently, if the tiling has any translational symmetry at all, it must be purely horizontal. We represent a translation by (x, y, 0) by the complex number z = x + i y. By considering the knobbles on one layer, we know that z must be a Gaussian integer (i.e. divisible by 1). By considering the knobbles on the layer above, z must also be divisible by . Considering all of these layers and using unique factorisation, we get that z is divisible by all integer powers of 2 + i, which is only the case for z = 0. So the tiling cannot have non-trivial translational symmetries, completing the proof of aperiodicity. Q. E. D.
Weakly versus strongly aperiodic
This monotile, together with Schmitt’s original monotile and the Schmitt-Conway-Danzer tile, can tile space screw-symmetrically. As such, it is described as weakly aperiodic. The first strongly aperiodic monotile (which admits no infinite cyclic group of symmetries) was found by Jean Taylor and Joshua Socolar.

Block cellular automata
On an infinite square lattice, the B36/S125 cellular automaton proceeds similarly to Conway’s Game of Life (B3/S23), but with different birth and survival conditions. Specifically, a dead cell becomes live if surrounded by 3 or 6 live neighbours, and a live cell survives if surrounded by 1, 2 or 5 live neighbours. As usual (c.f. question 9), each cell dies unless specified otherwise.
The dynamics are not as interesting as the Game of Life, although there is a naturally-occurring glider and related infinite-growth pattern (discovered by Nathaniel Johnston during a massive search with random initial conditions):
One of the more interesting properties of the cellular automaton is that if the universe is composed entirely of 2 × 2 blocks in a square lattice arrangement, this will be the case for all time. We can think of B36/S125 as emulating a simpler cellular automaton:
This cellular automaton is slightly unusual in that the cells are in different positions in odd generations and even generations. A spacetime diagram of this gives truncated octahedral cells in a configuration known as the body-centred cubic lattice:
For want of a better term (block cellular automaton is slightly ambiguous, and can refer to the similar — albeit distinct — concept of a Margolus neighbourhood), I shall henceforth refer to these as BCC automata. Nathaniel Johnston investigated rectangular oscillators in the BCC automaton arising from B36/S125, showing how they in turn emulate an even simpler (one-dimensional) cellular automaton, namely Wolfram’s Rule 90. It transpires that this behaviour was investigated earlier by Dean Hickerson on the notorious Usenet group, comp.theory.cell-automata.

Oscillators of periods 6 (2^3 – 2) and 14 (2^4 – 2) in the B36/S125 cellular automaton.
Emulation can go in the opposite direction. For a cellular automaton such as Life, we can arbitrarily group the cells into 2 × 2 blocks, thus enabling it to be emulated in a 16-state BCC automaton. This is used as the base case for Bill Gosper’s algorithm HashLife, which uses hashed quadtrees to simulate patterns frighteningly quickly.

A more aperiodic monotile
This article can be regarded as a sequel to my 5 × 5 monotile. Since its announcement, several variants have been discovered. In particular, towards the end of this article we shall present a three-dimensional monotile with the following properties:
- Nonperiodic by the definition given in Socolar-Taylor (2010);
- No tiling has translational symmetry.
These properties have been independently achieved before (the first by the three-dimensional Socolar-Taylor tile; the second by the Schmitt-Conway-Danzer biprism and the aforementioned 5 × 5 monotile), but this appears to be the first time that a single prototile satisfies both properties. Unfortunately, the tiling still admits screw symmetry, so it is not strongly aperiodic.
Primitive and balanced monotiles
Note that the 5 × 5 monotile is completely specified by the pair (3 + 4i, 5) of Gaussian integers of equal norm. The first of these gives the period of the tile with respect to the grid of knobbles on the upper surface, and the second gives the period of the tile with respect to the grid of indentations on the lower surface.
A variant is described as primitive if (z, w) have equal norm and are coprime. The aforementioned example is not primitive, since we can take out a common factor of 1 + 2i, giving the primitive pair (1 + 2i, 1 − 2i). Since the periods are complex conjugates, we describe the monotile as being balanced.
Note that, unlike the examples where w is an integer, we’re not actually allowed to have the knobbles protruding over the edge, since that would result in the indentations also protruding (obviously impossible).
If a balanced tile is flipped over, the knobbles and indentations precisely switch positions. If, instead, we replace both the knobbles and indentations with a self-complementary shape, then the tile will have dihedral symmetry (invariant under being flipped over). This will be useful for the culmination of this article: a nonperiodic translation-free monotile.
Hexagonal variants
Warren Smith (of n-body fame) proposed a hexagonal variant, based upon the Eisenstein integers rather than the Gaussian integers. The simplest primitive balanced monotile has seven knobbles and is specified by the pair (3 + ω, 3 − ω), where ω is a primitive cube root of unity.
As described at the end of the previous section, this can be modified to give a self-complementary variant invariant under the operation of ‘flipping over’, and exhibiting a rotational symmetry group isomorphic to the dihedral group D12. (For an explicit construction, replace each knobble and indentation with a hexagonally-symmetric ring of alternating pegs and grooves.)
So far, this is no qualitatively different from the monotiles discussed earlier. However, we can then slice this hexagonal prism along its equator, separating the two halves slightly and inserting [the Cartesian product of an interval with] a Taylor-Socolar aperiodic monotile. In particular, we choose the disconnected variant from Figure 6 of the paper by Socolar and Taylor:
The problem with this is that we now have a disconnected 3D tile with the desired properties (nonperiodic and translation-free). Nevertheless, it can be converted into a connected tile (indeed, a polyhedron) by ‘skewering’ the other connected components with helical protrusions, and boring complementary helical holes in the prisms (c.f. duck genitalia, but without the problematic chirality issues).

Cipher 42: Sudoku II
This can be regarded as a sequel to cipher 21. One of the problems with that cipher was the fact that people could cheat by using an online Sudoku solver; I don’t believe that this suffers from the same vulnerability. This particular cipher is separated into a key and a string of ciphertext. Here’s the key:
And here’s the ciphertext:
KUWRTQQMMUCMRVAYUHXSRJULTJLKNJVKSEITIHXDSSYZWIIFUMSKAOYQKXEHYMWPMON
Enjoy.
