0}$. We will show that $k=c$.
Denote by $\nu_{p}(n)$ the number of prime factors $p$ in $n$, that is, the maximum exponent $\beta$ for which $p^{\beta} \mid n$. For every $\ell \geqslant 1$ and $p \in P$, the Lifting the Exponent Lemma provides
$$
\nu_{p}\left(10^{\ell \alpha}-1\right)=\nu_{p}\left(\left(10^{\alpha}\right)^{\ell}-1\right)=\nu_{p}\left(10^{\alpha}-1\right)+\nu_{p}(\ell)=\nu_{p}(m)+\nu_{p}(\ell)
$$
so
$$
\begin{aligned}
c m \mid 10^{k \alpha}-1 & \Longleftrightarrow \forall p \in P ; \nu_{p}(c m) \leqslant \nu_{p}\left(10^{k \alpha}-1\right) \\
& \Longleftrightarrow \forall p \in P ; \nu_{p}(m)+\nu_{p}(c) \leqslant \nu_{p}(m)+\nu_{p}(k) \\
& \Longleftrightarrow \forall p \in P ; \nu_{p}(c) \leqslant \nu_{p}(k) \\
& \Longleftrightarrow c \mid k .
\end{aligned}
$$
The first such $k$ is $k=c$, so $\operatorname{ord}_{c m}(10)=c \alpha$.
Comment. The Lifting the Exponent Lemma states that, for any odd prime $p$, any integers $a, b$ coprime with $p$ such that $p \mid a-b$, and any positive integer exponent $n$,
$$
\nu_{p}\left(a^{n}-b^{n}\right)=\nu_{p}(a-b)+\nu_{p}(n),
$$
and, for $p=2$,
$$
\nu_{2}\left(a^{n}-b^{n}\right)=\nu_{2}\left(a^{2}-b^{2}\right)+\nu_{p}(n)-1 .
$$
Both claims can be proved by induction on $n$.
N5. Find all pairs $(p, q)$ of prime numbers with $p>q$ for which the number
$$
\frac{(p+q)^{p+q}(p-q)^{p-q}-1}{(p+q)^{p-q}(p-q)^{p+q}-1}
$$
is an integer.
(Japan)
Answer: The only such pair is $(3,2)$.
Solution. Let $M=(p+q)^{p-q}(p-q)^{p+q}-1$, which is relatively prime with both $p+q$ and $p-q$. Denote by $(p-q)^{-1}$ the multiplicative inverse of $(p-q)$ modulo $M$.
By eliminating the term -1 in the numerator,
$$
\begin{aligned}
(p+q)^{p+q}(p-q)^{p-q}-1 & \equiv(p+q)^{p-q}(p-q)^{p+q}-1 \quad(\bmod M) \\
(p+q)^{2 q} & \equiv(p-q)^{2 q} \quad(\bmod M) \\
\left((p+q) \cdot(p-q)^{-1}\right)^{2 q} & \equiv 1 \quad(\bmod M)
\end{aligned}
$$
Case 1: $q \geqslant 5$.
Consider an arbitrary prime divisor $r$ of $M$. Notice that $M$ is odd, so $r \geqslant 3$. By (2), the multiplicative order of $\left((p+q) \cdot(p-q)^{-1}\right)$ modulo $r$ is a divisor of the exponent $2 q$ in (2), so it can be $1,2, q$ or $2 q$.
By Fermat's theorem, the order divides $r-1$. So, if the order is $q$ or $2 q$ then $r \equiv 1(\bmod q)$. If the order is 1 or 2 then $r \mid(p+q)^{2}-(p-q)^{2}=4 p q$, so $r=p$ or $r=q$. The case $r=p$ is not possible, because, by applying Fermat's theorem,
$M=(p+q)^{p-q}(p-q)^{p+q}-1 \equiv q^{p-q}(-q)^{p+q}-1=\left(q^{2}\right)^{p}-1 \equiv q^{2}-1=(q+1)(q-1) \quad(\bmod p)$
and the last factors $q-1$ and $q+1$ are less than $p$ and thus $p \nmid M$. Hence, all prime divisors of $M$ are either $q$ or of the form $k q+1$; it follows that all positive divisors of $M$ are congruent to 0 or 1 modulo $q$.
Now notice that
$$
M=\left((p+q)^{\frac{p-q}{2}}(p-q)^{\frac{p+q}{2}}-1\right)\left((p+q)^{\frac{p-q}{2}}(p-q)^{\frac{p+q}{2}}+1\right)
$$
is the product of two consecutive positive odd numbers; both should be congruent to 0 or 1 modulo $q$. But this is impossible by the assumption $q \geqslant 5$. So, there is no solution in Case 1 .
Case 2: $q=2$.
By (1), we have $M \mid(p+q)^{2 q}-(p-q)^{2 q}=(p+2)^{4}-(p-2)^{4}$, so
$$
\begin{gathered}
(p+2)^{p-2}(p-2)^{p+2}-1=M \leqslant(p+2)^{4}-(p-2)^{4} \leqslant(p+2)^{4}-1, \\
(p+2)^{p-6}(p-2)^{p+2} \leqslant 1 .
\end{gathered}
$$
If $p \geqslant 7$ then the left-hand side is obviously greater than 1 . For $p=5$ we have $(p+2)^{p-6}(p-2)^{p+2}=7^{-1} \cdot 3^{7}$ which is also too large.
There remains only one candidate, $p=3$, which provides a solution:
$$
\frac{(p+q)^{p+q}(p-q)^{p-q}-1}{(p+q)^{p-q}(p-q)^{p+q}-1}=\frac{5^{5} \cdot 1^{1}-1}{5^{1} \cdot 1^{5}-1}=\frac{3124}{4}=781 .
$$
So in Case 2 the only solution is $(p, q)=(3,2)$.
Case 3: $q=3$.
Similarly to Case 2, we have
$$
M \left\lvert\,(p+q)^{2 q}-(p-q)^{2 q}=64 \cdot\left(\left(\frac{p+3}{2}\right)^{6}-\left(\frac{p-3}{2}\right)^{6}\right)\right.
$$
Since $M$ is odd, we conclude that
$$
M \left\lvert\,\left(\frac{p+3}{2}\right)^{6}-\left(\frac{p-3}{2}\right)^{6}\right.
$$
and
$$
\begin{gathered}
(p+3)^{p-3}(p-3)^{p+3}-1=M \leqslant\left(\frac{p+3}{2}\right)^{6}-\left(\frac{p-3}{2}\right)^{6} \leqslant\left(\frac{p+3}{2}\right)^{6}-1 \\
64(p+3)^{p-9}(p-3)^{p+3} \leqslant 1
\end{gathered}
$$
If $p \geqslant 11$ then the left-hand side is obviously greater than 1 . If $p=7$ then the left-hand side is $64 \cdot 10^{-2} \cdot 4^{10}>1$. If $p=5$ then the left-hand side is $64 \cdot 8^{-4} \cdot 2^{8}=2^{2}>1$. Therefore, there is no solution in Case 3.
N6. Find the smallest positive integer $n$, or show that no such $n$ exists, with the following property: there are infinitely many distinct $n$-tuples of positive rational numbers $\left(a_{1}, a_{2}, \ldots, a_{n}\right)$ such that both
$$
a_{1}+a_{2}+\cdots+a_{n} \quad \text { and } \quad \frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{n}}
$$
are integers.
(Singapore)
Answer: $n=3$.
Solution 1. For $n=1, a_{1} \in \mathbb{Z}_{>0}$ and $\frac{1}{a_{1}} \in \mathbb{Z}_{>0}$ if and only if $a_{1}=1$. Next we show that
(i) There are finitely many $(x, y) \in \mathbb{Q}_{>0}^{2}$ satisfying $x+y \in \mathbb{Z}$ and $\frac{1}{x}+\frac{1}{y} \in \mathbb{Z}$
Write $x=\frac{a}{b}$ and $y=\frac{c}{d}$ with $a, b, c, d \in \mathbb{Z}_{>0}$ and $\operatorname{gcd}(a, b)=\operatorname{gcd}(c, d)=1$. Then $x+y \in \mathbb{Z}$ and $\frac{1}{x}+\frac{1}{y} \in \mathbb{Z}$ is equivalent to the two divisibility conditions
$$
b d \mid a d+b c \quad(1) \quad \text { and } \quad a c \mid a d+b c
$$
Condition (1) implies that $d|a d+b c \Longleftrightarrow d| b c \Longleftrightarrow d \mid b$ since $\operatorname{gcd}(c, d)=1$. Still from (1) we get $b|a d+b c \Longleftrightarrow b| a d \Longleftrightarrow b \mid d$ since $\operatorname{gcd}(a, b)=1$. From $b \mid d$ and $d \mid b$ we have $b=d$.
An analogous reasoning with condition (2) shows that $a=c$. Hence $x=\frac{a}{b}=\frac{c}{d}=y$, i.e., the problem amounts to finding all $x \in \mathbb{Q}_{>0}$ such that $2 x \in \mathbb{Z}_{>0}$ and $\frac{2}{x} \in \mathbb{Z}_{>0}$. Letting $n=2 x \in \mathbb{Z}_{>0}$, we have that $\frac{2}{x} \in \mathbb{Z}_{>0} \Longleftrightarrow \frac{4}{n} \in \mathbb{Z}_{>0} \Longleftrightarrow n=1,2$ or 4 , and there are finitely many solutions, namely $(x, y)=\left(\frac{1}{2}, \frac{1}{2}\right),(1,1)$ or $(2,2)$.
(ii) There are infinitely many triples $(x, y, z) \in \mathbb{Q}_{>0}^{2}$ such that $x+y+z \in \mathbb{Z}$ and $\frac{1}{x}+\frac{1}{y}+\frac{1}{z} \in \mathbb{Z}$. We will look for triples such that $x+y+z=1$, so we may write them in the form
$$
(x, y, z)=\left(\frac{a}{a+b+c}, \frac{b}{a+b+c}, \frac{c}{a+b+c}\right) \quad \text { with } a, b, c \in \mathbb{Z}_{>0}
$$
We want these to satisfy
$$
\frac{1}{x}+\frac{1}{y}+\frac{1}{z}=\frac{a+b+c}{a}+\frac{a+b+c}{b}+\frac{a+b+c}{c} \in \mathbb{Z} \Longleftrightarrow \frac{b+c}{a}+\frac{a+c}{b}+\frac{a+b}{c} \in \mathbb{Z}
$$
Fixing $a=1$, it suffices to find infinitely many pairs $(b, c) \in \mathbb{Z}_{>0}^{2}$ such that
$$
\frac{1}{b}+\frac{1}{c}+\frac{c}{b}+\frac{b}{c}=3 \Longleftrightarrow b^{2}+c^{2}-3 b c+b+c=0
$$
To show that equation (*) has infinitely many solutions, we use Vieta jumping (also known as root flipping): starting with $b=2, c=3$, the following algorithm generates infinitely many solutions. Let $c \geqslant b$, and view (*) as a quadratic equation in $b$ for $c$ fixed:
$$
b^{2}-(3 c-1) \cdot b+\left(c^{2}+c\right)=0
$$
Then there exists another root $b_{0} \in \mathbb{Z}$ of ( $\left.* *\right)$ which satisfies $b+b_{0}=3 c-1$ and $b \cdot b_{0}=c^{2}+c$. Since $c \geqslant b$ by assumption,
$$
b_{0}=\frac{c^{2}+c}{b} \geqslant \frac{c^{2}+c}{c}>c
$$
Hence from the solution $(b, c)$ we obtain another one $\left(c, b_{0}\right)$ with $b_{0}>c$, and we can then "jump" again, this time with $c$ as the "variable" in the quadratic (*). This algorithm will generate an infinite sequence of distinct solutions, whose first terms are
$(2,3),(3,6),(6,14),(14,35),(35,90),(90,234),(234,611),(611,1598),(1598,4182), \ldots$
Comment. Although not needed for solving this problem, we may also explicitly solve the recursion given by the Vieta jumping. Define the sequence $\left(x_{n}\right)$ as follows:
$$
x_{0}=2, \quad x_{1}=3 \quad \text { and } \quad x_{n+2}=3 x_{n+1}-x_{n}-1 \text { for } n \geqslant 0
$$
Then the triple
$$
(x, y, z)=\left(\frac{1}{1+x_{n}+x_{n+1}}, \frac{x_{n}}{1+x_{n}+x_{n+1}}, \frac{x_{n+1}}{1+x_{n}+x_{n+1}}\right)
$$
satisfies the problem conditions for all $n \in \mathbb{N}$. It is easy to show that $x_{n}=F_{2 n+1}+1$, where $F_{n}$ denotes the $n$-th term of the Fibonacci sequence ( $F_{0}=0, F_{1}=1$, and $F_{n+2}=F_{n+1}+F_{n}$ for $n \geqslant 0$ ).
Solution 2. Call the $n$-tuples $\left(a_{1}, a_{2}, \ldots, a_{n}\right) \in \mathbb{Q}_{>0}^{n}$ satisfying the conditions of the problem statement good, and those for which
$$
f\left(a_{1}, \ldots, a_{n}\right) \stackrel{\text { def }}{=}\left(a_{1}+a_{2}+\cdots+a_{n}\right)\left(\frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{n}}\right)
$$
is an integer pretty. Then good $n$-tuples are pretty, and if $\left(b_{1}, \ldots, b_{n}\right)$ is pretty then
$$
\left(\frac{b_{1}}{b_{1}+b_{2}+\cdots+b_{n}}, \frac{b_{2}}{b_{1}+b_{2}+\cdots+b_{n}}, \ldots, \frac{b_{n}}{b_{1}+b_{2}+\cdots+b_{n}}\right)
$$
is good since the sum of its components is 1 , and the sum of the reciprocals of its components equals $f\left(b_{1}, \ldots, b_{n}\right)$. We declare pretty $n$-tuples proportional to each other equivalent since they are precisely those which give rise to the same good $n$-tuple. Clearly, each such equivalence class contains exactly one $n$-tuple of positive integers having no common prime divisors. Call such $n$-tuple a primitive pretty tuple. Our task is to find infinitely many primitive pretty $n$-tuples.
For $n=1$, there is clearly a single primitive 1 -tuple. For $n=2$, we have $f(a, b)=\frac{(a+b)^{2}}{a b}$, which can be integral (for coprime $a, b \in \mathbb{Z}_{>0}$ ) only if $a=b=1$ (see for instance (i) in the first solution).
Now we construct infinitely many primitive pretty triples for $n=3$. Fix $b, c, k \in \mathbb{Z}_{>0}$; we will try to find sufficient conditions for the existence of an $a \in \mathbb{Q}_{>0}$ such that $f(a, b, c)=k$. Write $\sigma=b+c, \tau=b c$. From $f(a, b, c)=k$, we have that $a$ should satisfy the quadratic equation
$$
a^{2} \cdot \sigma+a \cdot\left(\sigma^{2}-(k-1) \tau\right)+\sigma \tau=0
$$
whose discriminant is
$$
\Delta=\left(\sigma^{2}-(k-1) \tau\right)^{2}-4 \sigma^{2} \tau=\left((k+1) \tau-\sigma^{2}\right)^{2}-4 k \tau^{2}
$$
We need it to be a square of an integer, say, $\Delta=M^{2}$ for some $M \in \mathbb{Z}$, i.e., we want
$$
\left((k+1) \tau-\sigma^{2}\right)^{2}-M^{2}=2 k \cdot 2 \tau^{2}
$$
so that it suffices to set
$$
(k+1) \tau-\sigma^{2}=\tau^{2}+k, \quad M=\tau^{2}-k .
$$
The first relation reads $\sigma^{2}=(\tau-1)(k-\tau)$, so if $b$ and $c$ satisfy
$$
\tau-1 \mid \sigma^{2} \quad \text { i.e. } \quad b c-1 \mid(b+c)^{2}
$$
then $k=\frac{\sigma^{2}}{\tau-1}+\tau$ will be integral, and we find rational solutions to (1), namely
$$
a=\frac{\sigma}{\tau-1}=\frac{b+c}{b c-1} \quad \text { or } \quad a=\frac{\tau^{2}-\tau}{\sigma}=\frac{b c \cdot(b c-1)}{b+c}
$$
We can now find infinitely many pairs ( $b, c$ ) satisfying (2) by Vieta jumping. For example, if we impose
$$
(b+c)^{2}=5 \cdot(b c-1)
$$
then all pairs $(b, c)=\left(v_{i}, v_{i+1}\right)$ satisfy the above condition, where
$$
v_{1}=2, v_{2}=3, \quad v_{i+2}=3 v_{i+1}-v_{i} \quad \text { for } i \geqslant 0
$$
For $(b, c)=\left(v_{i}, v_{i+1}\right)$, one of the solutions to (1) will be $a=(b+c) /(b c-1)=5 /(b+c)=$ $5 /\left(v_{i}+v_{i+1}\right)$. Then the pretty triple $(a, b, c)$ will be equivalent to the integral pretty triple
$$
\left(5, v_{i}\left(v_{i}+v_{i+1}\right), v_{i+1}\left(v_{i}+v_{i+1}\right)\right)
$$
After possibly dividing by 5 , we obtain infinitely many primitive pretty triples, as required.
Comment. There are many other infinite series of $(b, c)=\left(v_{i}, v_{i+1}\right)$ with $b c-1 \mid(b+c)^{2}$. Some of them are:
$$
\begin{array}{llll}
v_{1}=1, & v_{2}=3, & v_{i+1}=6 v_{i}-v_{i-1}, & \left(v_{i}+v_{i+1}\right)^{2}=8 \cdot\left(v_{i} v_{i+1}-1\right) ; \\
v_{1}=1, & v_{2}=2, & v_{i+1}=7 v_{i}-v_{i-1}, & \left(v_{i}+v_{i+1}\right)^{2}=9 \cdot\left(v_{i} v_{i+1}-1\right) ; \\
v_{1}=1, & v_{2}=5, & v_{i+1}=7 v_{i}-v_{i-1}, & \left(v_{i}+v_{i+1}\right)^{2}=9 \cdot\left(v_{i} v_{i+1}-1\right)
\end{array}
$$
(the last two are in fact one sequence prolonged in two possible directions).
N7. Say that an ordered pair $(x, y)$ of integers is an irreducible lattice point if $x$ and $y$ are relatively prime. For any finite set $S$ of irreducible lattice points, show that there is a homogenous polynomial in two variables, $f(x, y)$, with integer coefficients, of degree at least 1 , such that $f(x, y)=1$ for each $(x, y)$ in the set $S$.
Note: A homogenous polynomial of degree $n$ is any nonzero polynomial of the form
$$
f(x, y)=a_{0} x^{n}+a_{1} x^{n-1} y+a_{2} x^{n-2} y^{2}+\cdots+a_{n-1} x y^{n-1}+a_{n} y^{n} .
$$
Solution 1. First of all, we note that finding a homogenous polynomial $f(x, y)$ such that $f(x, y)= \pm 1$ is enough, because we then have $f^{2}(x, y)=1$. Label the irreducible lattice points $\left(x_{1}, y_{1}\right)$ through $\left(x_{n}, y_{n}\right)$. If any two of these lattice points $\left(x_{i}, y_{i}\right)$ and $\left(x_{j}, y_{j}\right)$ lie on the same line through the origin, then $\left(x_{j}, y_{j}\right)=\left(-x_{i},-y_{i}\right)$ because both of the points are irreducible. We then have $f\left(x_{j}, y_{j}\right)= \pm f\left(x_{i}, y_{i}\right)$ whenever $f$ is homogenous, so we can assume that no two of the lattice points are collinear with the origin by ignoring the extra lattice points.
Consider the homogenous polynomials $\ell_{i}(x, y)=y_{i} x-x_{i} y$ and define
$$
g_{i}(x, y)=\prod_{j \neq i} \ell_{j}(x, y)
$$
Then $\ell_{i}\left(x_{j}, y_{j}\right)=0$ if and only if $j=i$, because there is only one lattice point on each line through the origin. Thus, $g_{i}\left(x_{j}, y_{j}\right)=0$ for all $j \neq i$. Define $a_{i}=g_{i}\left(x_{i}, y_{i}\right)$, and note that $a_{i} \neq 0$.
Note that $g_{i}(x, y)$ is a degree $n-1$ polynomial with the following two properties:
1. $g_{i}\left(x_{j}, y_{j}\right)=0$ if $j \neq i$.
2. $g_{i}\left(x_{i}, y_{i}\right)=a_{i}$.
For any $N \geqslant n-1$, there also exists a polynomial of degree $N$ with the same two properties. Specifically, let $I_{i}(x, y)$ be a degree 1 homogenous polynomial such that $I_{i}\left(x_{i}, y_{i}\right)=1$, which exists since $\left(x_{i}, y_{i}\right)$ is irreducible. Then $I_{i}(x, y)^{N-(n-1)} g_{i}(x, y)$ satisfies both of the above properties and has degree $N$.
We may now reduce the problem to the following claim:
Claim: For each positive integer $a$, there is a homogenous polynomial $f_{a}(x, y)$, with integer coefficients, of degree at least 1 , such that $f_{a}(x, y) \equiv 1(\bmod a)$ for all relatively prime $(x, y)$.
To see that this claim solves the problem, take $a$ to be the least common multiple of the numbers $a_{i}(1 \leqslant i \leqslant n)$. Take $f_{a}$ given by the claim, choose some power $f_{a}(x, y)^{k}$ that has degree at least $n-1$, and subtract appropriate multiples of the $g_{i}$ constructed above to obtain the desired polynomial.
We prove the claim by factoring $a$. First, if $a$ is a power of a prime ( $a=p^{k}$ ), then we may choose either:
- $f_{a}(x, y)=\left(x^{p-1}+y^{p-1}\right)^{\phi(a)}$ if $p$ is odd;
- $f_{a}(x, y)=\left(x^{2}+x y+y^{2}\right)^{\phi(a)}$ if $p=2$.
Now suppose $a$ is any positive integer, and let $a=q_{1} q_{2} \cdots q_{k}$, where the $q_{i}$ are prime powers, pairwise relatively prime. Let $f_{q_{i}}$ be the polynomials just constructed, and let $F_{q_{i}}$ be powers of these that all have the same degree. Note that
$$
\frac{a}{q_{i}} F_{q_{i}}(x, y) \equiv \frac{a}{q_{i}} \quad(\bmod a)
$$
for any relatively prime $x, y$. By Bézout's lemma, there is an integer linear combination of the $\frac{a}{q_{i}}$ that equals 1 . Thus, there is a linear combination of the $F_{q_{i}}$ such that $F_{q_{i}}(x, y) \equiv 1$ $(\bmod a)$ for any relatively prime $(x, y)$; and this polynomial is homogenous because all the $F_{q_{i}}$ have the same degree.
Solution 2. As in the previous solution, label the irreducible lattice points $\left(x_{1}, y_{1}\right), \ldots,\left(x_{n}, y_{n}\right)$ and assume without loss of generality that no two of the points are collinear with the origin. We induct on $n$ to construct a homogenous polynomial $f(x, y)$ such that $f\left(x_{i}, y_{i}\right)=1$ for all $1 \leqslant i \leqslant n$.
If $n=1$ : Since $x_{1}$ and $y_{1}$ are relatively prime, there exist some integers $c, d$ such that $c x_{1}+d y_{1}=1$. Then $f(x, y)=c x+d y$ is suitable.
If $n \geqslant 2$ : By the induction hypothesis we already have a homogeneous polynomial $g(x, y)$ with $g\left(x_{1}, y_{1}\right)=\ldots=g\left(x_{n-1}, y_{n-1}\right)=1$. Let $j=\operatorname{deg} g$,
$$
g_{n}(x, y)=\prod_{k=1}^{n-1}\left(y_{k} x-x_{k} y\right)
$$
and $a_{n}=g_{n}\left(x_{n}, y_{n}\right)$. By assumption, $a_{n} \neq 0$. Take some integers $c, d$ such that $c x_{n}+d y_{n}=1$. We will construct $f(x, y)$ in the form
$$
f(x, y)=g(x, y)^{K}-C \cdot g_{n}(x, y) \cdot(c x+d y)^{L}
$$
where $K$ and $L$ are some positive integers and $C$ is some integer. We assume that $L=K j-n+1$ so that $f$ is homogenous.
Due to $g\left(x_{1}, y_{1}\right)=\ldots=g\left(x_{n-1}, y_{n-1}\right)=1$ and $g_{n}\left(x_{1}, y_{1}\right)=\ldots=g_{n}\left(x_{n-1}, y_{n-1}\right)=0$, the property $f\left(x_{1}, y_{1}\right)=\ldots=f\left(x_{n-1}, y_{n-1}\right)=1$ is automatically satisfied with any choice of $K, L$, and $C$.
Furthermore,
$$
f\left(x_{n}, y_{n}\right)=g\left(x_{n}, y_{n}\right)^{K}-C \cdot g_{n}\left(x_{n}, y_{n}\right) \cdot\left(c x_{n}+d y_{n}\right)^{L}=g\left(x_{n}, y_{n}\right)^{K}-C a_{n}
$$
If we have an exponent $K$ such that $g\left(x_{n}, y_{n}\right)^{K} \equiv 1\left(\bmod a_{n}\right)$, then we may choose $C$ such that $f\left(x_{n}, y_{n}\right)=1$. We now choose such a $K$.
Consider an arbitrary prime divisor $p$ of $a_{n}$. By
$$
p \mid a_{n}=g_{n}\left(x_{n}, y_{n}\right)=\prod_{k=1}^{n-1}\left(y_{k} x_{n}-x_{k} y_{n}\right)
$$
there is some $1 \leqslant k