Maths Olympiad Prep

Library / CGMO /8 of 14

CGMO, 2022

Number theory Difficulty 7.0 National Olympiad Prove it China

Given a prime number p≥5p \ge 5. Find the number of different residues for the product of three consecutive positive integers modulo pp.

Solution

Let the set D={0,1,…,p−1}D = \{0, 1, \dots, p-1\}, and let the polynomial f(x)=(x−1)x(x+1)=x3−xf(x) = (x-1)x(x+1) = x^3-x. The congruence and congruence symbol “≡\equiv” in this question refer to congruence modulo pp. For k=0,1,2,3k=0, 1, 2, 3, let
Bk={b∈D∣there are exactly k elements a∈D such that f(a)≡b}. B_k = \{b \in D \mid \text{there are exactly } k \text{ elements } a \in D \text{ such that } f(a) \equiv b\}.
Consider an element bb in B2B_2, i.e., there exist a1≢a2a_1 \not\equiv a_2 such that f(a1)≡f(a2)≡bf(a_1) \equiv f(a_2) \equiv b. In this case,
0≡(a13−a1)−(a23−a2)=(a1−a2)(a12+a1a2+a22−1)⇒a12+a1a2+a22≡1. 0 \equiv (a_1^3 - a_1) - (a_2^3 - a_2) = (a_1 - a_2)(a_1^2 + a_1a_2 + a_2^2 - 1) \Rightarrow a_1^2 + a_1a_2 + a_2^2 \equiv 1.
Thus, for a3=−a1−a2a_3 = -a_1 - a_2, we have a32+a3a1+a12=(a1+a2)2−(a1+a2)a1+a12≡1a_3^2 + a_3a_1 + a_1^2 = (a_1 + a_2)^2 - (a_1 + a_2)a_1 + a_1^2 \equiv 1, so it can be deduced that f(a3)≡f(a1)≡bf(a_3) \equiv f(a_1) \equiv b, by the definition of B2B_2, a3a_3 is congruent to one of a1,a2a_1, a_2, so either a2≡−2a1a_2 \equiv -2a_1 or a1≡−2a2a_1 \equiv -2a_2, assume the former, in this case, a12+a1a2+a22≡3a12≡1a_1^2 + a_1a_2 + a_2^2 \equiv 3a_1^2 \equiv 1, 3b≡3a13−3a1≡−2a13b \equiv 3a_1^3 - 3a_1 \equiv -2a_1. When 3 is a quadratic residue modulo pp, a1a_1 has two solutions; when 3 is not a quadratic residue modulo pp, a1a_1 has no solution. Therefore, there are exactly 1+(3p)1 + (\frac{3}{p}) solutions for a1a_1, and the corresponding bb also has 1+(3p)1 + (\frac{3}{p}) solutions, i.e., ∣B2∣=1+(3p)|B_2| = 1 + (\frac{3}{p}).
Obviously, ∣B1∣+2∣B2∣+3∣B3∣=∣D∣=p. \text{Obviously, } |B_1| + 2|B_2| + 3|B_3| = |D| = p.
On the other hand, consider the pairs (u,v)(u, v) that satisfy "f(u)≡f(v)f(u) \equiv f(v) and u≢vu \not\equiv v" (called a collision). This is equivalent to u2+uv+v2≡1u^2 + uv + v^2 \equiv 1 and u−v≢0u - v \not\equiv 0. After changing variables to (x,y)≡(u−v2,u+v2)(x, y) \equiv (\frac{u-v}{2}, \frac{u+v}{2}) (i.e., (u,v)≡(x+y,y−x)(u, v) \equiv (x+y, y-x), such that (x,y)(x, y) and (u,v)(u, v) correspond one-to-one), it is transformed into x2+3y2≡1x^2 + 3y^2 \equiv 1 and x≢0x \not\equiv 0.
We consider the number of (x,y)(x, y) pairs satisfying x2+3y2≡1(modp)x^2+3y^2 \equiv 1 \pmod p (i.e., (3y)2≡3−3x2(3y)^2 \equiv 3-3x^2).
T=∑x=1p1+(3−3x2p)=p+(−3p)∑x=1p(x2−1p)=p+(−3p)∑x=2p(x+1x−1p)=p+(−3p)∑x=1p−1(1+2x−1p)=p+(−3p)∑z=1p−1(z+1p)=p−(−3p). \begin{aligned} T &= \sum_{x=1}^{p} 1 + \left(\frac{3-3x^2}{p}\right) = p + \left(\frac{-3}{p}\right) \sum_{x=1}^{p} \left(\frac{x^2-1}{p}\right) = p + \left(\frac{-3}{p}\right) \sum_{x=2}^{p} \left(\frac{\frac{x+1}{x-1}}{p}\right) \\ &= p + \left(\frac{-3}{p}\right) \sum_{x=1}^{p-1} \left(\frac{1+\frac{2}{x-1}}{p}\right) = p + \left(\frac{-3}{p}\right) \sum_{z=1}^{p-1} \left(\frac{z+1}{p}\right) = p - \left(\frac{-3}{p}\right). \end{aligned}
The above formula uses the fact that z=2x−1z = \frac{2}{x-1} traverses the complete set of residues modulo pp, and that ∑k=1p(kp)=0\sum_{k=1}^{p}(\frac{k}{p}) = 0. Among the TT pairs (x,y)(x, y), there are exactly 1+(3p)1 + (\frac{3}{p}) pairs for which x≡0x \equiv 0 (i.e., 3y2≡13y^2 \equiv 1). Therefore, the number of ordered collision pairs (u,v)(u, v) is
M=T−1−(3p)=p−(−3p)−1−(3p)=T−∣B2∣. M = T - 1 - \left(\frac{3}{p}\right) = p - \left(\frac{-3}{p}\right) - 1 - \left(\frac{3}{p}\right) = T - |B_2|.
Thus, there are exactly M2\frac{M}{2} unordered collision pairs (u,v)(u, v). Since the elements in B3B_3 correspond to 3 collisions, the elements in B2B_2 correspond to 1 collision, and the elements in B1B_1 and B0B_0 correspond to 0 collisions, it follows that ∣B2∣+3∣B3∣=M2|B_2| + 3|B_3| = \frac{M}{2}.
Thus, ∣B3∣=M−2∣B2∣6|B_3| = \frac{M-2|B_2|}{6}, so the number of all possible residues of f(x)f(x) modulo pp is
∣B1∣+∣B2∣+∣B3∣=p−∣B2∣−2∣B3∣=p−M+∣B2∣3=p−T3=2p+(−3p)3=⌊2p+13⌋. |B_1| + |B_2| + |B_3| = p - |B_2| - 2|B_3| = p - \frac{M + |B_2|}{3} = p - \frac{T}{3} = \frac{2p + (\frac{-3}{p})}{3} = \left\lfloor \frac{2p + 1}{3} \right\rfloor.

Note 1: Another way to calculate the number of solutions TT is:
Consider the congruence equation x2+3y2≡z2x^2 + 3y^2 \equiv z^2, which is equivalent to 3y2≡z2−x2=(z+x)(z−x)3y^2 \equiv z^2 - x^2 = (z+x)(z-x), having p2p^2 solutions (y≡0y \equiv 0 has exactly 2p−12p-1 solutions, y≡1y \equiv 1 has exactly p−1p-1 solutions, and so on). The number of solutions with z≡0z \equiv 0 is
m0=1+(p−1)[1+(−3p)], m_0 = 1 + (p-1)[1 + \left(\frac{-3}{p}\right)],
and the number of solutions for the remaining z≡1,z≡2,...,z≡p−1z \equiv 1, z \equiv 2, ..., z \equiv p-1 are equal (using (x,y,z)↔(kx,ky,kz)(x, y, z) \leftrightarrow (kx, ky, kz) to map the solutions with z≡1z \equiv 1 to the solutions with z≡kz \equiv k), each equal to T=p2−m0p−1=p−(−3p)T = \frac{p^2-m_0}{p-1} = p - \left(\frac{-3}{p}\right).
If one is not familiar with Legendre symbols, one can first obtain 0≤m0≤2p0 \le m_0 \le 2p, and deduce that the number of solutions to x2+3y2≡1x^2 + 3y^2 \equiv 1 is T∈p−1,p,p+1T \in p-1, p, p+1. The subsequent answer to this problem is p−T3p - \frac{T}{3}, which is an integer. From this, we can still get the needed answer.
Note 2: Another interpretation of the number of solutions T=p−(−3p)T = p - \left(\frac{-3}{p}\right) is: For each yy, the number of xx that satisfy x2≡1−3y2x^2 \equiv 1 - 3y^2 is 1+(1−3y2p)1 + \left(\frac{1-3y^2}{p}\right), therefore
T−p=∑y=0p−1(1−3y2p)≡∑y=0p−1(1−3y2)p−12=∑y=0p−1((−3)p−12yp−1+⋯+1)≡(−3)p−12(p−1)=−(−3p). \begin{aligned} T - p &= \sum_{y=0}^{p-1} \left( \frac{1 - 3y^2}{p} \right) \equiv \sum_{y=0}^{p-1} (1 - 3y^2)^{\frac{p-1}{2}} \\ &= \sum_{y=0}^{p-1} \left( \left(-3\right)^{\frac{p-1}{2}} y^{p-1} + \cdots + 1 \right) \equiv (-3)^{\frac{p-1}{2}} (p-1) = - \left( \frac{-3}{p} \right). \end{aligned}

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.