# Plouffe Rays - Part 2 - Circles

This is part two of a series investigating patterns in Plouffe Rays.

In this part we'll be exploring patterns similar to below where multiple concentric circles are formed.

### k=29, n=168

• When will we see a concentric ring pattern?
• How many rings will it have?
• What are the diameters of the rings?
• Which rays correspond to the tangents to the rings?

## Chords and Circles

TODO: Some discussion of chord length and radius

• Chord length, arclength, distance from centre

• Equal length chords

• Circle of tangents to midpoints

• Curve formed by tangent lines - "envelope"

• Area 0 circle in the middle

## Modular arithmetic

The arclength of a chord from $x$ to $f(x)$ is just $|f(x) - x|$. Let's ignore the absolute value function, and just consider $f(x) - x$, we want this to take on some constant value multiple times so that we have a circle.

\begin{aligned} f(x) - x &\equiv c \pmod{n} \\ kx - x &\equiv c \pmod{n} \\ (k - 1)x &\equiv c \pmod{n} \end{aligned}

This type of equation is known as a linear congruence, and we can use the following results:

• Let $d$ be the greatest common divisor of $k - 1$ and $n$
• If $c$ is not a multiple of $d$, then there are no solutions
• If $c$ is a multiple of $d$, then there are $d$ solutions.
• We can find the first of these solutions, $x_0$ by solving the congruence $\frac{k - 1}{d} x_0 \equiv \frac{c}{d} \pmod{\frac{n}{d}}$
• The remaining solutions are $x_t = x_0 + t\frac{n}{d}$ for $t = \{1, 2, \ldots d -1 \}$

Example Let $n = 12$ and $k = 9$:

$d = \gcd(k-1, n) = \gcd(8, 12) = 4$

Hence we have $n/d = 12/4 = 3$ different possible values for $c$, each of which will occur for 4 values of x.

\begin{aligned} & 8 \cdot 0 \equiv 0 \qquad & 8 \cdot 1 \equiv 8 \qquad & 8 \cdot 2 \equiv 4 \\ & 8 \cdot 3 \equiv 0 \qquad & 8 \cdot 4 \equiv 8 \qquad & 8 \cdot 5 \equiv 4 \\ & 8 \cdot 6 \equiv 0 \qquad & 8 \cdot 7 \equiv 8 \qquad & 8 \cdot 8 \equiv 4 \\ & 8 \cdot 9 \equiv 0 \qquad & 8 \cdot 10 \equiv 8 \qquad & 8 \cdot 11 \equiv 4 \end{aligned}

So, lets consider the chords of this diagram:

• When x = {0,3,6,9}, we have $f(x) - x \equiv 0 \implies f(x) \equiv x$, hence the start and endpoint of the chord is the same, so it won't be visible.
• When x = {1,4,7,10}, we have $f(x) - x \equiv 8$ - this is the larger arclength, the length we're interested in is $n - 8 = 4$.
• When x = {2,5,8,11}, we have an arclength of 4, so these chords will be tangent to the same circle.
• Hence we expect to see a single circle composed of chords of length 4.

Voilà!

(TODO: Draw inner circle)

Ok, so now we just need to tighten up some loose ends.

When we have $f(x) - x \equiv 0$ we don't have a circle. Looking back to the results on linear congruences, we can see:

• $c = 0$ is a multiple of $d$ (zero times $d$) so this will happend for all circle patterns.
• The x values are $x_0 = 0$, $x_t = t\frac{n}{d}$

(TODO: Deal with symmetry / major arc length) When n/d is odd there are $(n/d - 1) / 2$ circles (pairs) When n/d is even there are $n/d /2$ circles (one of these is the "point" circle)

## Conclusions

Theorem (Circle Patterns)

A circle pattern forms only when $d = \gcd( k-1, n) > 1$.

• Let $q = \frac{n}{d}$ It will contain $C = \lfloor \frac{q}{2} \rfloor$ "circles"
• Each circle consists of $2d$ chords which are tangent to the circle, and touch at the midpoint, with:
• x values $X_i = \{ x | x \equiv \pm i \pmod { q } \}$
• arc length TODO
Corollary: Any plouffe ray with $\gcd(k - 1, n) = 1$ has symmetrically matched pairs of chords with each possible length $\{0,1, \ldots, \lfloor n/2 \rfloor \}$