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. Enumerating integral Apollonian circle packings The curvatures are a root quadruple (the smallest in some integral circle packing) if . They are primitive when . Defining a new set of variables by the matrix equation gives a system where satisfies the Descartes equation precisely when . Furthermore, is primitive precisely when , and is a root quadruple precisely when . This relationship can be used to find all the primitive root quadruples with a given negative bend . It follows from and that , and hence that . Therefore, any root quadruple will satisfy . By iterating over all the possible values of , , and one can find all the primitive root quadruples. The following Python code demonstrates this algorithm, producing the primitive root quadruples listed above. import math def get_primitive_bends(n): if n == 0: yield 0, 0, 1, 1 return for m in range(math.ceil(n / math.sqrt(3))): s = m**2 + n**2 for d1 in range(max(2 * m, 1), math.floor(math.sqrt(s)) + 1): d2, remainder = divmod(s, d1) if remainder == 0 and math.gcd(n, d1, d2) == 1: yield -n, d1 + n, d2 + n, d1 + d2 + n - 2 * m for n in range(15): for bends in get_primitive_bends(n): print(bends) 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 C1; the gasket described by curvatures (−10, 18, 23, 27) is an example. D1 symmetry Whenever two of the largest five circles in the gasket have the same curvature, that gasket will have D1 symmetry, which corresponds to a reflection along a diameter of the bounding circle, with no rotational symmetry. D2 symmetry If two different curvatures are repeated within the first five, the gasket will have D2 symmetry; such a symmetry consists of two reflections (perpendicular to each other) along diameters of the bounding circle,