OFFSET
1,1
COMMENTS
4 mutually tangent circles satisfy 2 (a^2 + b^2 + c^2 + d^2) = (a + b + c + d)^2 where a,b,c,d are the curvatures.
LINKS
Wikipedia, Apollonian gasket
EXAMPLE
a, b, c, d
12, 4, 1, 1
15, 3, 2, 2
23, 6, 3, 2
24, 12, 1, 1
28, 9, 4, 1
MATHEMATICA
aMax = 100;
Do[
If[GCD[a, b, c] > 1, Continue[]];
d = a + b + c - 2 Sqrt[a b + a c + b c];
If[d // IntegerQ // Not, Continue[]];
(*{a, b, c, d}*)a // Sow;
, {a, aMax}
, {b, (2 a)/Sqrt[3] - a // Ceiling, (Sqrt[a] - 1)^2}
, {c, (a-b)^2/(4(a+b))//Ceiling, Min[b, (Sqrt[a]-Sqrt[b])^2-1//Ceiling]}
] // Reap // Last // Last(*//TableForm*)
d =.;
CROSSREFS
KEYWORD
nonn
AUTHOR
Albert Lau, Jul 03 2016
STATUS
approved