Subfield: Number Theory


Question: Let $\mathbb{Z}_{>0}$ be the set of positive integers. A positive integer constant $C$ is given. Find all functions $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$ such that, for all positive integers $a$ and $b$ satisfying $a+b>C$,

$$
a+f(b) \mid a^{2}+b f(a)
\tag{*}
$$

Solution:
It is easy to verify that the functions $f(a)=k a$ satisfy $(*)$. Thus, in the proofs below, we will only focus on the converse implication: that condition (*) implies that $f=k a$.

A common minor part of these solutions is the derivation of some relatively easy bounds on the function $f$. An upper bound is easily obtained by setting $a=1$ in (*), giving the inequality

$$
f(b) \leqslant b \cdot f(1)
$$

for all sufficiently large $b$. The corresponding lower bound is only marginally more difficult to obtain: substituting $b=1$ in the original equation shows that

$$
a+f(1) \mid\left(a^{2}+f(a)\right)-(a-f(1)) \cdot(a+f(1))=f(1)^{2}+f(a)
$$

for all sufficiently large $a$. It follows from this that one has the lower bound

$$
f(a) \geqslant a+f(1) \cdot(1-f(1))
$$

again for all sufficiently large $a$.

Each of the following proofs makes use of at least one of these bounds.


First, we show that $b \mid f(b)^{2}$ for all $b$. To do this, we choose a large positive integer $n$ so that $n b-f(b) \geqslant C$. Setting $a=n b-f(b)$ in $(*)$ then shows that

$$
n b \mid(n b-f(b))^{2}+b f(n b-f(b))
$$

so that $b \mid f(b)^{2}$ as claimed.

Now in particular we have that $p \mid f(p)$ for every prime $p$. If we write $f(p)=k(p) \cdot p$, then the bound $f(p) \leqslant f(1) \cdot p$ (valid for $p$ sufficiently large) shows that some value $k$ of $k(p)$ must be attained for infinitely many $p$. We will show that $f(a)=k a$ for all positive integers $a$. To do this, we substitute $b=p$ in $(*)$, where $p$ is any sufficiently large prime for which $k(p)=k$, obtaining

$$
a+k p \mid\left(a^{2}+p f(a)\right)-a(a+k p)=p f(a)-p k a .
$$

For suitably large $p$ we have $\operatorname{gcd}(a+k p, p)=1$, and hence we have

$$
a+k p \mid f(a)-k a
$$

But the only way this can hold for arbitrarily large $p$ is if $f(a)-k a=0$. This concludes the proof.
It is easy to verify that the functions $f(a)=k a$ satisfy $(*)$. Thus, in the proofs below, we will only focus on the converse implication: that condition (*) implies that $f=k a$.

A common minor part of these solutions is the derivation of some relatively easy bounds on the function $f$. An upper bound is easily obtained by setting $a=1$ in (*), giving the inequality

$$
f(b) \leqslant b \cdot f(1)
$$

for all sufficiently large $b$. The corresponding lower bound is only marginally more difficult to obtain: substituting $b=1$ in the original equation shows that

$$
a+f(1) \mid\left(a^{2}+f(a)\right)-(a-f(1)) \cdot(a+f(1))=f(1)^{2}+f(a)
$$

for all sufficiently large $a$. It follows from this that one has the lower bound

$$
f(a) \geqslant a+f(1) \cdot(1-f(1))
$$

again for all sufficiently large $a$.

Each of the following proofs makes use of at least one of these bounds.

First, we substitute $b=1$ in $(*)$ and rearrange to find that

$$
\frac{f(a)+f(1)^{2}}{a+f(1)}=f(1)-a+\frac{a^{2}+f(a)}{a+f(1)}
$$

is a positive integer for sufficiently large $a$. Since $f(a) \leqslant a f(1)$, for all sufficiently large $a$, it follows that $\frac{f(a)+f(1)^{2}}{a+f(1)} \leqslant f(1)$ also and hence there is a positive integer $k$ such that $\frac{f(a)+f(1)^{2}}{a+f(1)}=k$ for infinitely many values of $a$. In other words,

$$
f(a)=k a+f(1) \cdot(k-f(1))
$$

for infinitely many $a$.

Fixing an arbitrary choice of $a$ in (*), we have that

$$
\frac{a^{2}+b f(a)}{a+k b+f(1) \cdot(k-f(1))}
$$

is an integer for infinitely many $b$ (the same $b$ as above, maybe with finitely many exceptions). On the other hand, for $b$ taken sufficiently large, this quantity becomes arbitrarily close to $\frac{f(a)}{k}$; this is only possible if $\frac{f(a)}{k}$ is an integer and

$$
\frac{a^{2}+b f(a)}{a+k b+f(1) \cdot(k-f(1))}=\frac{f(a)}{k}
$$

for infinitely many $b$. This rearranges to

$$
\frac{f(a)}{k} \cdot(a+f(1) \cdot(k-f(1)))=a^{2}
\tag{**}
$$

Hence $a^{2}$ is divisible by $a+f(1) \cdot(k-f(1))$, and hence so is $f(1)^{2}(k-f(1))^{2}$. The only way this can occur for all $a$ is if $k=f(1)$, in which case $(* *)$ provides that $f(a)=k a$ for all $a$, as desired.
It is easy to verify that the functions $f(a)=k a$ satisfy $(*)$. Thus, in the proofs below, we will only focus on the converse implication: that condition (*) implies that $f=k a$.

A common minor part of these solutions is the derivation of some relatively easy bounds on the function $f$. An upper bound is easily obtained by setting $a=1$ in (*), giving the inequality

$$
f(b) \leqslant b \cdot f(1)
$$

for all sufficiently large $b$. The corresponding lower bound is only marginally more difficult to obtain: substituting $b=1$ in the original equation shows that

$$
a+f(1) \mid\left(a^{2}+f(a)\right)-(a-f(1)) \cdot(a+f(1))=f(1)^{2}+f(a)
$$

for all sufficiently large $a$. It follows from this that one has the lower bound

$$
f(a) \geqslant a+f(1) \cdot(1-f(1))
$$

again for all sufficiently large $a$.

Each of the following proofs makes use of at least one of these bounds.

Fix any two distinct positive integers $a$ and $b$. From $(*)$ it follows that the two integers

$$
\left(a^{2}+c f(a)\right) \cdot(b+f(c)) \text { and }\left(b^{2}+c f(b)\right) \cdot(a+f(c))
$$

are both multiples of $(a+f(c)) \cdot(b+f(c))$ for all sufficiently large $c$. Taking an appropriate linear combination to eliminate the $c f(c)$ term, we find after expanding out that the integer

$$
\left[a^{2} f(b)-b^{2} f(a)\right] \cdot f(c)+[(b-a) f(a) f(b)] \cdot c+[a b(a f(b)-b f(a))]
\tag{1}
$$

is also a multiple of $(a+f(c)) \cdot(b+f(c))$.

But as $c$ varies, $(1)$ is bounded above by a positive multiple of $c$ while $(a+f(c)) \cdot(b+f(c))$ is bounded below by a positive multiple of $c^{2}$. The only way that such a divisibility can hold is if in fact

$$
\left[a^{2} f(b)-b^{2} f(a)\right] \cdot f(c)+[(b-a) f(a) f(b)] \cdot c+[a b(a f(b)-b f(a))]=0
\tag{2}
$$

for sufficiently large $c$. Since the coefficient of $c$ in this linear relation is nonzero, it follows that there are constants $k, \ell$ such that $f(c)=k c+\ell$ for all sufficiently large $c$; the constants $k$ and $\ell$ are necessarily integers.

The value of $\ell$ satisfies

$$
\left[a^{2} f(b)-b^{2} f(a)\right] \cdot \ell+[a b(a f(b)-b f(a))]=0
\tag{3}
$$

and hence $b \mid \ell a^{2} f(b)$ for all $a$ and $b$. Taking $b$ sufficiently large so that $f(b)=k b+\ell$, we thus have that $b \mid \ell^{2} a^{2}$ for all sufficiently large $b$; this implies that $\ell=0$. From (3) it then follows that $\frac{f(a)}{a}=\frac{f(b)}{b}$ for all $a \neq b$, so that there is a constant $k$ such that $f(a)=k a$ for all $a$ ( $k$ is equal to the constant defined earlier).
It is easy to verify that the functions $f(a)=k a$ satisfy $(*)$. Thus, in the proofs below, we will only focus on the converse implication: that condition (*) implies that $f=k a$.

A common minor part of these solutions is the derivation of some relatively easy bounds on the function $f$. An upper bound is easily obtained by setting $a=1$ in (*), giving the inequality

$$
f(b) \leqslant b \cdot f(1)
$$

for all sufficiently large $b$. The corresponding lower bound is only marginally more difficult to obtain: substituting $b=1$ in the original equation shows that

$$
a+f(1) \mid\left(a^{2}+f(a)\right)-(a-f(1)) \cdot(a+f(1))=f(1)^{2}+f(a)
$$

for all sufficiently large $a$. It follows from this that one has the lower bound

$$
f(a) \geqslant a+f(1) \cdot(1-f(1))
$$

again for all sufficiently large $a$.

Each of the following proofs makes use of at least one of these bounds.


Let $\Gamma$ denote the set of all points $(a, f(a))$, so that $\Gamma$ is an infinite subset of the upper-right quadrant of the plane. For a point $A=(a, f(a))$ in $\Gamma$, we define a point $A^{\prime}=\left(-f(a),-f(a)^{2} / a\right)$ in the lower-left quadrant of the plane, and let $\Gamma^{\prime}$ denote the set of all such points $A^{\prime}$.

![](https://cdn.mathpix.com/cropped/2023_12_21_5db419644d3b656627a9g-1.jpg?height=551&width=645&top_left_y=450&top_left_x=708)

Claim. For any point $A \in \Gamma$, the set $\Gamma$ is contained in finitely many lines through the point $A^{\prime}$. Proof. Let $A=(a, f(a))$. The functional equation (with $a$ and $b$ interchanged) can be rewritten as $b+f(a) \mid a f(b)-b f(a)$, so that all but finitely many points in $\Gamma$ are contained in one of the lines with equation

$$
a y-f(a) x=m(x+f(a))
$$

for $m$ an integer. Geometrically, these are the lines through $A^{\prime}=\left(-f(a),-f(a)^{2} / a\right)$ with gradient $\frac{f(a)+m}{a}$. Since $\Gamma$ is contained, with finitely many exceptions, in the region $0 \leqslant y \leqslant$ $f(1) \cdot x$ and the point $A^{\prime}$ lies strictly in the lower-left quadrant of the plane, there are only finitely many values of $m$ for which this line meets $\Gamma$. This concludes the proof of the claim.

Now consider any distinct points $A, B \in \Gamma$. It is clear that $A^{\prime}$ and $B^{\prime}$ are distinct. A line through $A^{\prime}$ and a line through $B^{\prime}$ only meet in more than one point if these two lines are equal to the line $A^{\prime} B^{\prime}$. It then follows from the above claim that the line $A^{\prime} B^{\prime}$ must contain all but finitely many points of $\Gamma$. If $C$ is another point of $\Gamma$, then the line $A^{\prime} C^{\prime}$ also passes through all but finitely many points of $\Gamma$, which is only possible if $A^{\prime} C^{\prime}=A^{\prime} B^{\prime}$.

We have thus seen that there is a line $\ell$ passing through all points of $\Gamma^{\prime}$ and through all but finitely many points of $\Gamma$. We claim that this line passes through the origin $O$ and passes through every point of $\Gamma$. To see this, note that by construction $A, O, A^{\prime}$ are collinear for every point $A \in \Gamma$. Since $\ell=A A^{\prime}$ for all but finitely many points $A \in \Gamma$, it thus follows that $O \in \ell$. Thus any $A \in \Gamma$ lies on the line $\ell=A^{\prime} O$.

Since $\Gamma$ is contained in a line through $O$, it follows that there is a real constant $k$ (the gradient of $\ell$ ) such that $f(a)=k a$ for all $a$. The number $k$ is, of course, a positive integer.

Final answer: $f(a)=k a$ for some constant $k \in \mathbb{Z}_{>0}$ (irrespective of the value of $C$ )