Using the first two layers together

Definition

One may also take the union of the first two layers: $$B^{(\leq 2)}_{N,a} := A_{N,a} \cap \bigl((\{1, 2, N-2, N-1\} \times \{1, \ldots, N-1\}) \cup (\{1, \ldots, N-1\} \times \{1, 2, N-2, N-1\})\bigr).$$ Define $$S^{(\leq 2)}(N, a) := \operatorname{Area}(\operatorname{conv}(B^{(\leq 2)}_{N,a})), \qquad S^{(\leq 2)}(N) := \sum_{a=0}^{N-1} S^{(\leq 2)}(N, a).$$

In plainer language, $B^{(\leq 2)}_{N,a}$ means: keep only the outer frame and the next ring in, then retain only the cells whose residue is $a$. So this two-layer model is the first place where the residue class is allowed to use more than one boundary layer at once.

Like the one-layer models, this two-layer quantity is a natural source not only of geometric approximations but also of new sequences, totals, and later series questions.

Rectangles after the transformation $u = x + y$, $v = x - y$

The change of coordinates $$u = x + y, \qquad v = x - y$$ is introduced for one simple reason: in the original $(x,y)$-plane, the boundary hulls are slanted parallelograms, while in the $(u,v)$-plane they become ordinary axis-aligned rectangles. That makes it much easier to see how the first two layers interact.

For odd $N$, the first boundary and the second boundary each become axis-aligned rectangles in $(u, v)$-space. The first boundary has half-widths $$\alpha_1 = N - a - 1, \qquad \beta_1 = a - 1,$$ and the second boundary has half-widths $$\alpha_2 = |N - b - 2|, \qquad \beta_2 = |b - 2|, \qquad b \equiv 2^{-1}a \pmod{N}.$$ Thus the combined two-layer hull is the convex hull of two centered rectangles. This reduces the problem to elementary convex geometry.

This is also the point where the coordinate-sum and coordinate-difference literature becomes visibly relevant. Bower, Evans, Luo, and Miller study the arithmetic sizes of the sets of values taken by $x+y$ and $x-y$ on reduced modular hyperbolas [@bowerevansluomiller2012]. In the present chapter we do not count those values. We fix one residue class and use the same linear forms as actual coordinates, so that the first two MTMN layers become centered rectangles and their interaction becomes an exact convex-hull calculation.

@fig:uv-transform and @fig:two-layer-rectangles show the first and second boundary sets for $N = 11$, $a = 3$, in both coordinate systems.

The first and second boundary sets for $N = 11$, $a = 3$, in the original $(x,y)$ coordinates (left) and after the linear change of variables $(u,v) = (x+y, x-y)$ (right). In $(u,v)$-space, each boundary layer becomes an axis-aligned rectangle.

The two rectangles $R_1$ and $R_2$ in $(u,v)$-space for $N = 11$, $a = 3$, together with the convex hull of their union. This hull is the combined two-layer model.

Proposition (Piecewise formula for the two-layer odd-$N$ model). Assume $N$ is odd. Let $R_1$ and $R_2$ be the centered rectangles in $(u,v)$-space with half-widths $(\alpha_1, \beta_1)$ and $(\alpha_2, \beta_2)$ as above. Then $$S^{(\leq 2)}(N, a) = \frac{1}{2}\operatorname{Area}(\operatorname{conv}(R_1 \cup R_2)).$$ In words: once one passes to $(u,v)$-coordinates, the two-layer model is nothing more than the convex hull of two ordinary rectangles, followed by the factor $1/2$ that converts area back to the original coordinates. In particular: (a) if one rectangle contains the other, then $S^{(\leq 2)}(N, a)$ is just the larger of $S^{(1)}(N, a)$ and $S^{(2)}(N, a)$; (b) if the rectangles cross, say $\alpha_1 \geq \alpha_2$ and $\beta_2 \geq \beta_1$, then $$S^{(\leq 2)}(N, a) = 2\alpha_1\beta_1 + (\alpha_1 + \alpha_2)(\beta_2 - \beta_1).$$

Idea of proof. In the first quadrant of $(u,v)$-space, the convex hull of two centered axis-aligned rectangles is either a rectangle or a pentagon with vertices $$(0, 0), \quad (\alpha_1, 0), \quad (\alpha_1, \beta_1), \quad (\alpha_2, \beta_2), \quad (0, \beta_2).$$ Its area is elementary to compute. One then uses central symmetry and the Jacobian factor $1/2$ when passing back to $(x,y)$-space. □