research/lab/rs/apollonian
1 directory and 2 files in research/lab/rs/apollonian.
Apollonian
- Grows an integral Apollonian circle packing from its root quadruple in exact integers, checks Descartes on every quadruple it makes, identifies the strip packing's line-tangent circles as the Ford circles, and prints the curvature census.
- A circle is the triple
(k, k x, k y): curvature, and the centre scaled by it. A line isk = 0with(k x, k y)its outward unit normal. Every entry is an integer for every packing here. - The one move is the reflection
v' = 2(v_1 + v_2 + v_3) - vapplied to all three coordinates at once, which swaps the two circles tangent to the other three; it needs no square root, so the whole run is integer arithmetic. - Six exact integer identities hold on every quadruple, all of them the bilinear form
B(u, v) = (sum u_i)(sum v_i) - 2 sum u_i v_ion the four columns:B(k, k) = B(k, kx) = B(k, ky) = B(kx, ky) = 0andB(kx, kx) = B(ky, ky) = -4. The first is Descartes; the rest are the position half of the same theorem, and the reflection preserves all six because it lies in the form's orthogonal group. - The two roots are the strip packing
(0, 0, 2, 2), two lines a unit apart with the unit-diameter circles atx = 0andx = 1between them, and the bounded packing(-1, 2, 2, 3), whose outer circle is the unit circle. - The tree is the standard one: from the root every swap is taken, from any later quadruple every swap but the one just undone, and a branch stops when the new curvature passes
T. Each node is one new circle, so the census is the node count and the root quadruple is not in it.
THE STRIP
- The strip packing is periodic in
x, so the census is taken on one period: the two swaps at the root that replace a line are kept and the two that translate are dropped, which leaves exactly the circles whose centre has0 < x < 1. The two root circles atx = 0andx = 1are the only ones of the whole packing on the boundary and are never counted, sostrayedtests the strict inequality,k x <= 0 || k x >= k. - A circle of the packing is tangent to the line
y = 0exactly whenk y = 1, and toy = 1exactly whenk y = k - 1, so the line-tangent census is read off the integers with no geometry. - Both line tests are for circles of positive curvature: the line
y = 1is(0, 0, 1)and would passk y = 1, the liney = 0is(0, 0, -1)and would passk y = k - 1. The tree never hands a line to either test, since a line is only ever replaced. fordwalks the Stern-Brocot tree of Farey pairs in exact integers and checks at every mediant that the reflection returns(k, k x, k y) = (2 r^2, 2 p r, 1)for the mediantp/rof the parentsa/bandc/d, that the quadruple(0, 2 b^2, 2 d^2, 2 r^2)satisfies Descartes, that the other root of that quadratic is2 (b - d)^2, and that the two parents are tangent,(a d - b c)^2 = 1.- The same walk sums
floor(Q/b)over the nodes of(0, 1), adds the node0/1at brightnessQ, and compares the total withQ(Q + 1)/2, the Farey stack's brightness on[0, 1).
RUN
cargo run --release -p apollonian- The verbs
ford,strip,censusanddesignrun one section each; about fourteen seconds in total,censustwelve of them. Prints only, writes nothing. N(T)in every table is the node count, so the root quadruple is excluded: four circles in the bounded column, one in the strip column.
WITNESSES
ford: atb <= 4000the walk makes 4863601 mediants againstsum_{b <= 4000} phi(b) - 1 = 4863601, with 0 broken quadruples, 0 coordinate misses and 0 non-tangent parents; brightness 8002000 against4000 * 4001 / 2. Same atb <= 50,200and1000: 773, 12231, 304191 nodes and 1275, 20100, 500500 brightness.strip: 20770674 circles toT = 2097152, tree depth 1023, 0 broken quadruples, 0 duplicate circles on theT <= 2048control (2448 circles, 2448 distinct), and 0 circles outside0 < k x < k. Curvatures fall in the residues0, 2, 8, 18mod 24, at 4144636, 6223160, 6241134 and 4161744.- Of those, 318963 have
k y = 1and every one of them is a Ford circle:k/2a perfect squareb^2,k xa multiple2 a bwithgcd(a, b) = 1and0 <= a <= b, 0 off-Ford. The same run reads 318963 tangent to the far line. stripon the decade grid:N(T)is2, 48, 950, 19298, 390478, 7899138atT = 10^1 .. 10^6, exponent by ratio1.3802, 1.2965, 1.3078, 1.3061, 1.3060.- The line-tangent count at curvature at most
2 Q^2issum_{b <= Q} phi(b) - 1atQ = 32,181and1024: 323, 10059 and 318963, and the top-tangent count is the same by the strip's reflection symmetry. stripon the octave grid, exponent as the ratiolog(N(T_2)/N(T_1)) / log(T_2/T_1):1.2925, 1.2722, 1.2716, 1.2925, 1.3073, 1.3011, 1.3064, 1.3050, 1.3056over the octave grid toT = 2097152.census: the bounded packing(-1, 2, 2, 3)toT = 10^7gives 555198593 circles, depth 3162, 0 broken quadruples and 67163 distinct circles against 67163 counted on theT <= 10^4control.N(T)is5, 165, 3325, 67163, 1359167, 27463391, 555198593atT = 10^1 .. 10^7.- The same census's exponent by ratio is
1.5185, 1.3043, 1.3053, 1.3061, 1.3055, 1.3057, and the flat readinglog N(T)/log Tis1.2492atT = 10^7, still climbing. - The bounded packing's curvatures fall in the eight residues
2, 3, 6, 11, 14, 15, 18, 23mod 24. design:base^deltaat the literaturedeltamisses every integer for2 <= base <= 100, the nearest being52^delta = 174.005426001, then68,89,49,23,20; the worst gap is0.488109816at base 47.- The same verb reads the miss as a dimension: the nearest design dimension in the window is
log 351/log 89 = 1.305694144, offdeltaby0.000007416, thenlog 247/log 68 = 1.305694579at0.000007851.
- src/1 item
- Cargo.toml96 B
- README.md5.7 kB