Daily

Random

Practice set

Baltic Way 2020 · Problem 18

Number Theory

Let n⩾1n \geqslant 1 be a positive integer. We say that an integer kk is a fan of nn if 0⩽k⩽n−10 \leqslant k \leqslant n-1 and there exist integers x,y,z∈Zx, y, z \in \mathbb{Z} such that

x2+y2+z2≡0( mod n);xyz≡k( mod n).\begin{aligned} x^{2}+y^{2}+z^{2} & \equiv 0 \quad(\bmod n) ; \\ x y z & \equiv k \quad(\bmod n) . \end{aligned}

Let f(n)f(n) be the number of fans of nn. Determine f(2020)f(2020).

Change pool

When you’re ready

Review material becomes available with the next Daily.

Review

Topics

Modular arithmetic · Diophantine equations

Solutions

Solution

Answer: f(2020)=f(4)⋅f(5)⋅f(101)=1⋅1⋅101=101f(2020)=f(4) \cdot f(5) \cdot f(101)=1 \cdot 1 \cdot 101=101.

To prove our claim we show that ff is multiplicative, that is, f(rs)=f(r)f(s)f(r s)=f(r) f(s) for coprime numbers r,s∈Nr, s \in \mathbb{N}, and that

(i) f(4)=1f(4)=1,

(ii) f(5)=1f(5)=1,

(iii) f(101)=101f(101)=101.

The multiplicative property follows from the Chinese Remainder Theorem.

(i) Integers x,yx, y and zz satisfy x2+y2+z2≡0 mod 4x^{2}+y^{2}+z^{2} \equiv 0 \bmod 4 if and only if they are all even. In this case xyz≡0 mod 4x y z \equiv 0 \bmod 4. Hence 0 is the only fan of 4 .

(ii) Integers x,yx, y and zz satisfy x2+y2+z2≡0 mod 5x^{2}+y^{2}+z^{2} \equiv 0 \bmod 5 if and only if at least one of them is divisible by 5 . In this case xyz≡0 mod 5x y z \equiv 0 \bmod 5. Hence 5 is the only fan of 5 .

(iii) We have 92+42+22=81+16+4=1019^{2}+4^{2}+2^{2}=81+16+4=101. Hence (9x)2+(4x)2+(2x)2(9 x)^{2}+(4 x)^{2}+(2 x)^{2} is divisible by 101 for every integer xx. Hence the residue of 9x⋅4x⋅2x=72x39 x \cdot 4 x \cdot 2 x=72 x^{3} upon division by 101 is a fan of 101 for every x∈Zx \in \mathbb{Z}. If we substitute x=t67x=t^{67}, then x3=t201≡t mod 101x^{3}=t^{201} \equiv t \bmod 101. Since 72 is coprime to 101 , the number 72x3≡72t72 x^{3} \equiv 72 t can take any residue modulo 101 .

Note: In general for p≢1( mod 3)p \not \equiv 1(\bmod 3), we have f(p)=pf(p)=p as soon as we have at least one non-zero fan.

Contest context

Results from Baltic Way 2020

10 teams

Mean score
1.7 / 5
Scores of 4 or 5
3 / 10
Estonia
1 / 5

Score distribution

05
11
21
30
41
52
All team scores
TeamScore
Germany5 / 5
Norway4 / 5
Poland2 / 5
Finland0 / 5
Latvia0 / 5
Estonia1 / 5
Denmark5 / 5
Sweden0 / 5
Lithuania0 / 5
Iceland0 / 5