# Apollonian gasket

In mathematics, an Apollonian gasket or Apollonian net is a fractal generated by starting with a triple of circles, each tangent to the other two, and successively filling in more circles, each tangent to another three. It is named after Greek mathematician Apollonius of Perga.

## Construction

The construction of the Apollonian gasket starts with three circles $C_{1}$, $C_{2}$, and $C_{3}$ (black in the figure), that are each tangent to the other two, but that do not have a single point of triple tangency. These circles may be of different sizes to each other, and it is allowed for two to be inside the third, or for all three to be outside each other. As Apollonius discovered, there exist two more circles $C_{4}$ and $C_{5}$ (red) that are tangent to all three of the original circles – these are called Apollonian circles. These five circles are separated from each other by six curved triangular regions, each bounded by the arcs from three pairwise-tangent circles. The construction continues by adding six more circles, one in each of these six curved triangles, tangent to its three sides. These in turn create 18 more curved triangles, and the construction continues by again filling these with tangent circles, ad infinitum.
Continued stage by stage in this way, the construction adds $2\cdot 3^{n}$ new circles at stage $n$, giving a total of $3^{n+1}+2$ circles after $n$ stages. In the limit, this set of circles is an Apollonian gasket. In it, each pair of tangent circles has an infinite Pappus chain of circles tangent to both circles in the pair.
The size of each new circle is determined by Descartes' theorem, which states that, for any four mutually tangent circles, the radii $r_{i}$ of the circles obeys the equation $\left({\frac {1}{r_{1}}}+{\frac {1}{r_{2}}}+{\frac {1}{r_{3}}}+{\frac {1}{r_{4}}}\right)^{2}=2\left({\frac {1}{r_{1}^{2}}}+{\frac {1}{r_{2}^{2}}}+{\frac {1}{r_{3}^{2}}}+{\frac {1}{r_{4}^{2}}}\right).$ This equation may have a solution with a negative radius; this means that one of the circles (the one with negative radius) surrounds the other three. One or two of the initial circles of this construction, or the circles resulting from this construction, can degenerate to a straight line, which can be thought of as a circle with infinite radius. When there are two lines, they must be parallel, and are considered to be tangent at a point at infinity. When the gasket includes two lines on the $x$-axis and one unit above it, and a circle of unit diameter tangent to both lines centered on the $y$-axis, then the circles that are tangent to the $x$-axis are the Ford circles, important in number theory.
The Apollonian gasket has a Hausdorff dimension of about 1.3057. Because it has a well-defined fractional dimension, even though it is not precisely self-similar, it can be thought of as a fractal.

## Symmetries

The Möbius transformations of the plane preserve the shapes and tangencies of circles, and therefore preserve the structure of an Apollonian gasket. Any two triples of mutually tangent circles in an Apollonian gasket may be mapped into each other by a Möbius transformation, and any two Apollonian gaskets may be mapped into each other by a Möbius transformation. In particular, for any two tangent circles in any Apollonian gasket, an inversion in a circle centered at the point of tangency (a special case of a Möbius transformation) will transform these two circles into two parallel lines, and transform the rest of the gasket into the special form of a gasket between two parallel lines. Compositions of these inversions can be used to transform any two points of tangency into each other. Möbius transformations are also isometries of the hyperbolic plane, so in hyperbolic geometry all Apollonian gaskets are congruent. In a sense, there is therefore only one Apollonian gasket, up to (hyperbolic) isometry.
The Apollonian gasket is the limit set of a group of Möbius transformations known as a Kleinian group.
For Euclidean symmetry transformations rather than Möbius transformations, in general, the Apollonian gasket will inherit the symmetries of its generating set of three circles. However, some triples of circles can generate Apollonian gaskets with higher symmetry than the initial triple; this happens when the same gasket has a different and more-symmetric set of generating circles. Particularly symmetric cases include the Apollonian gasket between two parallel lines (with infinite dihedral symmetry), the Apollonian gasket generated by three congruent circles in an equilateral triangle (with the symmetry of the triangle), and the Apollonian gasket generated by two circles of radius 1 surrounded by a circle of radius 2 (with two lines of reflective symmetry).

## Integral Apollonian circle packings

* Integral Apollonian circle packing defined by circle curvatures of (−1, 2, 2, 3)
* Integral Apollonian circle packing defined by circle curvatures of (−3, 5, 8, 8)
* Integral Apollonian circle packing defined by circle curvatures of (−12, 25, 25, 28)
* Integral Apollonian circle packing defined by circle curvatures of (−6, 10, 15, 19)
* Integral Apollonian circle packing defined by circle curvatures of (−10, 18, 23, 27)
If any four mutually tangent circles in an Apollonian gasket all have integer curvature (the inverse of their radius) then all circles in the gasket will have integer curvature. Since the equation relating curvatures in an Apollonian gasket, integral or not, is $a^{2}+b^{2}+c^{2}+d^{2}=2ab+2ac+2ad+2bc+2bd+2cd,\,$ it follows that one may move from one quadruple of curvatures to another by Vieta jumping, just as when finding a new Markov number. The first few of these integral Apollonian gaskets are listed in the following table. The table lists the curvatures of the largest circles in the gasket. Only the first three curvatures (of the five displayed in the table) are needed to completely describe each gasket – all other curvatures can be derived from these three.
Integral Apollonian gaskets :
| Beginning curvatures | Symmetry |
| −1, 2, 2, 3, 3 | D$_2$ |
| −2, 3, 6, 7, 7 | D$_1$ |
| −3, 4, 12, 13, 13 | D$_1$ |
| −3, 5, 8, 8, 12 | D$_1$ |
| −4, 5, 20, 21, 21 | D$_1$ |
| −4, 8, 9, 9, 17 | D$_1$ |
| −5, 6, 30, 31, 31 | D$_1$ |
| −5, 7, 18, 18, 22 | D$_1$ |
| −6, 7, 42, 43, 43 | D$_1$ |
| −6, 10, 15, 19, 19 | D$_1$ |
| −6, 11, 14, 15, 23 | C$_1$ |
| −7, 8, 56, 57, 57 | D$_1$ |
| −7, 9, 32, 32, 36 | D$_1$ |
| −7, 12, 17, 20, 24 | C$_1$ |
| −8, 9, 72, 73, 73 | D$_1$ |
| −8, 12, 25, 25, 33 | D$_1$ |
| −8, 13, 21, 24, 28 | C$_1$ |
| −9, 10, 90, 91, 91 | D$_1$ |
| −9, 11, 50, 50, 54 | D$_1$ |
| −9, 14, 26, 27, 35 | C$_1$ |
| −9, 18, 19, 22, 34 | C$_1$ |
| −10, 11, 110, 111, 111 | D$_1$ |
| −10, 14, 35, 39, 39 | D$_1$ |
| −10, 18, 23, 27, 35 | C$_1$ |
| −11, 12, 132, 133, 133 | D$_1$ |
| −11, 13, 72, 72, 76 | D$_1$ |
| −11, 16, 36, 37, 45 | C$_1$ |
| −11, 21, 24, 28, 40 | C$_1$ |
| −12, 13, 156, 157, 157 | D$_1$ |
| −12, 16, 49, 49, 57 | D$_1$ |
| −12, 17, 41, 44, 48 | C$_1$ |
| −12, 21, 28, 37, 37 | D$_1$ |
| −12, 21, 29, 32, 44 | C$_1$ |
| −12, 25, 25, 28, 48 | D$_1$ |
| −13, 14, 182, 183, 183 | D$_1$ |
| −13, 15, 98, 98, 102 | D$_1$ |
| −13, 18, 47, 50, 54 | C$_1$ |
| −13, 23, 30, 38, 42 | C$_1$ |
| −14, 15, 210, 211, 211 | D$_1$ |
| −14, 18, 63, 67, 67 | D$_1$ |
| −14, 19, 54, 55, 63 | C$_1$ |
| −14, 22, 39, 43, 51 | C$_1$ |
| −14, 27, 31, 34, 54 | C$_1$ |
| −15, 16, 240, 241, 241 | D$_1$ |
| −15, 17, 128, 128, 132 | D$_1$ |
| −15, 24, 40, 49, 49 | D$_1$ |
| −15, 24, 41, 44, 56 | C$_1$ |
| −15, 28, 33, 40, 52 | C$_1$ |
| −15, 32, 32, 33, 65 | D$_1$ |

### Enumerating integral Apollonian circle packings

The curvatures $(a,b,c,d)$ are a root quadruple (the smallest in some integral circle packing) if $a<0\leq b\leq c\leq d$. They are primitive when $\gcd(a,b,c,d)=1$. Defining a new set of variables $(x,d_{1},d_{2},m)$ by the matrix equation ${\begin{bmatrix}a\\b\\c\\d\end{bmatrix}}={\begin{bmatrix}1&0&0&0\\-1&1&0&0\\-1&0&1&0\\-1&1&1&-2\end{bmatrix}}{\begin{bmatrix}x\\d_{1}\\d_{2}\\m\end{bmatrix}}$ gives a system where $(a,b,c,d)$ satisfies the Descartes equation precisely when $x^{2}+m^{2}=d_{1}d_{2}$. Furthermore, $(a,b,c,d)$ is primitive precisely when $\gcd(x,d_{1},d_{2})=1$, and $(a,b,c,d)$ is a root quadruple precisely when $x<0\leq 2m\leq d_{1}\leq d_{2}$.
This relationship can be used to find all the primitive root quadruples with a given negative bend $x$. It follows from $2m\leq d_{1}$ and $2m\leq d_{2}$ that $4m^{2}\leq d_{1}d_{2}$, and hence that $3m^{2}\leq d_{1}d_{2}-m^{2}=x^{2}$. Therefore, any root quadruple will satisfy $0\leq m\leq |x|/{\sqrt {3}}$. By iterating over all the possible values of $m$, $d_{1}$, and $d_{2}$ one can find all the primitive root quadruples. The following Python code demonstrates this algorithm, producing the primitive root quadruples listed above.
The curvatures appearing in a primitive integral Apollonian circle packing must belong to a set of six or eight possible residues classes modulo 24, and numerical evidence supported that any sufficiently large integer from these residue classes would also be present as a curvature within the packing. This conjecture, known as the local-global conjecture, was proved to be false in 2023.

### Symmetry of integral Apollonian circle packings

There are multiple types of dihedral symmetry that can occur with a gasket depending on the curvature of the circles.

#### No symmetry

If none of the curvatures are repeated within the first five, the gasket contains no symmetry, which is represented by symmetry group C$_1$; the gasket described by curvatures (−10, 18, 23, 27) is an example.

#### D$_1$ symmetry

Whenever two of the largest five circles in the gasket have the same curvature, that gasket will have D$_1$ symmetry, which corresponds to a reflection along a diameter of the bounding circle, with no rotational symmetry.

#### D$_2$ symmetry

If two different curvatures are repeated within the first five, the gasket will have D$_2$ symmetry; such a symmetry consists of two reflections (perpendicular to each other) along diameters of the bounding circle, with a two-fold rotational symmetry of 180°. The gasket described by curvatures (−1, 2, 2, 3) is the only Apollonian gasket (up to a scaling factor) to possess D$_2$ symmetry.

#### D$_3$ symmetry

There are no integer gaskets with D$_3$ symmetry.
If the three circles with smallest positive curvature have the same curvature, the gasket will have D$_3$ symmetry, which corresponds to three reflections along diameters of the bounding circle (spaced 120° apart), along with three-fold rotational symmetry of 120°. In this case the ratio of the curvature of the bounding circle to the three inner circles is 2√3 − 3. As this ratio is not rational, no integral Apollonian circle packings possess this D$_3$ symmetry, although many packings come close.

#### Almost-D$_3$ symmetry

The figure at left is an integral Apollonian gasket that appears to have D$_3$ symmetry. The same figure is displayed at right, with labels indicating the curvatures of the interior circles, illustrating that the gasket actually possesses only the D$_1$ symmetry common to many other integral Apollonian gaskets.
The following table lists more of these almost-D$_3$ integral Apollonian gaskets. The sequence has some interesting properties, and the table lists a factorization of the curvatures, along with the multiplier needed to go from the previous set to the current one. The absolute values of the curvatures of the "a" disks obey the recurrence relation a(n) = 4a(n − 1) − a(n − 2) (sequence A001353 in the OEIS), from which it follows that the multiplier converges to √3 + 2 ≈ 3.732050807.
Integral Apollonian gaskets with near-D$_3$ symmetry :
| Curvature | Curvature | Curvature | Curvature | Factors | Factors | Factors | Multiplier | Multiplier | Multiplier | Multiplier |
| a | b | c | d | a | b | d | a | b | c | d |
| −1 | 2 | 2 | 3 | 1×1 | 1×2 | 1×3 | — | — | — | — |
| −4 | 8 | 9 | 9 | 2×2 | 2×4 | 3×3 | 4.000000000 | 4.000000000 | 4.500000000 | 3.000000000 |
| −15 | 32 | 32 | 33 | 3×5 | 4×8 | 3×11 | 3.750000000 | 4.000000000 | 3.555555556 | 3.666666667 |
| −56 | 120 | 121 | 121 | 8×7 | 8×15 | 11×11 | 3.733333333 | 3.750000000 | 3.781250000 | 3.666666667 |
| −209 | 450 | 450 | 451 | 11×19 | 15×30 | 11×41 | 3.732142857 | 3.750000000 | 3.719008264 | 3.727272727 |
| −780 | 1680 | 1681 | 1681 | 30×26 | 30×56 | 41×41 | 3.732057416 | 3.733333333 | 3.735555556 | 3.727272727 |
| −2911 | 6272 | 6272 | 6273 | 41×71 | 56×112 | 41×153 | 3.732051282 | 3.733333333 | 3.731112433 | 3.731707317 |
| −10864 | 23408 | 23409 | 23409 | 112×97 | 112×209 | 153×153 | 3.732050842 | 3.732142857 | 3.732302296 | 3.731707317 |
| −40545 | 87362 | 87362 | 87363 | 153×265 | 209×418 | 153×571 | 3.732050810 | 3.732142857 | 3.731983425 | 3.732026144 |

### Sequential curvatures

For any integer n > 0, there exists an Apollonian gasket defined by the following curvatures: (−n, n + 1, n(n + 1), n(n + 1) + 1). For example, the gaskets defined by (−2, 3, 6, 7), (−3, 4, 12, 13), (−8, 9, 72, 73), and (−9, 10, 90, 91) all follow this pattern. Because every interior circle that is defined by n + 1 can become the bounding circle (defined by −n) in another gasket, these gaskets can be nested. This is demonstrated in the figure at right, which contains these sequential gaskets with n running from 2 through 20.

## History

Although the Apollonian gasket is named for Apollonius of Perga -- because of its construction's dependence on the solution to the problem of Apollonius -- the earliest description of the gasket is from 1706 by Leibniz in a letter to Des Bosses. The first modern definition of the Apollonian gasket is given by Kasner and Supnick.