Maths Olympiad Prep

Library / /9 of 15

, 2022

Number theory Difficulty 7.0 National olympiad Prove it China

Given a prime number p5p \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,,p1}D = \{0, 1, \dots, p-1\}, and let the polynomial f(x)=(x1)x(x+1)=x3xf(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={bDthere are exactly k elements aD 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(a13a1)(a23a2)=(a1a2)(a12+a1a2+a221)a12+a1a2+a221. 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=a1a2a_3 = -a_1 - a_2, we have a32+a3a1+a12=(a1+a2)2(a1+a2)a1+a121a_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 a22a1a_2 \equiv -2a_1 or a12a2a_1 \equiv -2a_2, assume the former, in this case, a12+a1a2+a223a121a_1^2 + a_1a_2 + a_2^2 \equiv 3a_1^2 \equiv 1, 3b3a133a12a13b \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+2B2+3B3=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+v21u^2 + uv + v^2 \equiv 1 and uv≢0u - v \not\equiv 0. After changing variables to (x,y)(uv2,u+v2)(x, y) \equiv (\frac{u-v}{2}, \frac{u+v}{2}) (i.e., (u,v)(x+y,yx)(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+3y21x^2 + 3y^2 \equiv 1 and x≢0x \not\equiv 0.
We consider the number of (x,y)(x, y) pairs satisfying x2+3y21(modp)x^2+3y^2 \equiv 1 \pmod p (i.e., (3y)233x2(3y)^2 \equiv 3-3x^2).
T=x=1p1+(33x2p)=p+(3p)x=1p(x21p)=p+(3p)x=2p(x+1x1p)=p+(3p)x=1p1(1+2x1p)=p+(3p)z=1p1(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=2x1z = \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 x0x \equiv 0 (i.e., 3y213y^2 \equiv 1). Therefore, the number of ordered collision pairs (u,v)(u, v) is
M=T1(3p)=p(3p)1(3p)=TB2. 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+3B3=M2|B_2| + 3|B_3| = \frac{M}{2}.
Thus, B3=M2B26|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=pB22B3=pM+B23=pT3=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+3y2z2x^2 + 3y^2 \equiv z^2, which is equivalent to 3y2z2x2=(z+x)(zx)3y^2 \equiv z^2 - x^2 = (z+x)(z-x), having p2p^2 solutions (y0y \equiv 0 has exactly 2p12p-1 solutions, y1y \equiv 1 has exactly p1p-1 solutions, and so on). The number of solutions with z0z \equiv 0 is
m0=1+(p1)[1+(3p)], m_0 = 1 + (p-1)[1 + \left(\frac{-3}{p}\right)],
and the number of solutions for the remaining z1,z2,...,zp1z \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 z1z \equiv 1 to the solutions with zkz \equiv k), each equal to T=p2m0p1=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 0m02p0 \le m_0 \le 2p, and deduce that the number of solutions to x2+3y21x^2 + 3y^2 \equiv 1 is Tp1,p,p+1T \in p-1, p, p+1. The subsequent answer to this problem is pT3p - \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 x213y2x^2 \equiv 1 - 3y^2 is 1+(13y2p)1 + \left(\frac{1-3y^2}{p}\right), therefore
Tp=y=0p1(13y2p)y=0p1(13y2)p12=y=0p1((3)p12yp1++1)(3)p12(p1)=(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,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.