Best approximation by coprime numbers Denote $\in I = [1, +\infty).$ Define the function $f: I\times I \to \mathbb R^+$ as follows:  $$f(x, y) = \inf_{(n, m)\in {\rm CP}}\big(|x-n|+|y-m|\big), \,\, (x,y) \in I\times I,$$
where ${\rm CP}$ is the set of pairs of coprime integers. i.e.
$${\rm CP} : = \{(n,m) \in \mathbb N\times \mathbb N\,\, \text{s. t.}\,\, {\rm gcd}(n,m) = 1\}.$$
My question is:  Is the function $f$ bounded on $I\times I.$
Thank you for any hint.
 A: To simplify notation, let $M=(p_{ij})$ be a $n$-by-$n$ matrix containing $n^2$ distinct primes.
Using the Chinese remainder theorem, find a positive integer $k$ such that $k+i$ is divisible by the product of the entries of the $i^\text{th}$ row.
Then find a positive integer $l$ such that $l+j$ is divisible by the product of the entries of the $j^\text{th}$ column.
Because each row must intersect each column,
no coprime pair $a\in[k+1,k+n]$, $b\in[l+1,l+n]$ can be found.
A: If $x$ and $y$ are coprime, then $f(x,y)=0$ because we can take $n=x$, $m=y$.
To make $f(x,y)\ge1$ we need $(x,y)$ not to be a coprime pair, and we can do this by imposing the condition that they are both divisible by the prime $p_1=2$. So whenever $x\equiv0\pmod2$ and $y\equiv0\pmod2$, then we have $f(x,y)\ge1$.
To make $f(x,y)\ge2$ we also need $(x-1,y)$, $(x+1,y)$, $(x,y-1)$, and $(x,y+1)$ to not be coprime pairs. Those are all the coordinates with a manhattan distance of $1$ to $(x,y)$. Each of those four coordinates can be made to be not a coprime pair by requiring each to be divisible by another prime. So:
$$x-1\equiv 0 \pmod 3\\y\equiv 0 \pmod 3$$
$$x+1\equiv 0 \pmod 5\\y\equiv 0 \pmod 5$$
$$x\equiv 0 \pmod 7\\y-1\equiv 0 \pmod 7$$
$$x\equiv 0 \pmod {11}\\y+1\equiv 0 \pmod {11}$$
Using the Chinese Remainder Theorem we find that
$$x\equiv154 \pmod{2310}\\y\equiv120 \pmod{2310}$$
It is indeed the case that $f(154,120)\ge2$ because these coordinates and all neighbouring coordinates are not coprime pairs.
Clearly this process can be continued. To make $f(x,y)\ge3$ you need to impose $8$ more modular constraints on $(x,y)$, but the CRT guarantees that there is a solution.
In general there are $2d^2+2d+1$ coordinates with a Manhattan distance to $(x,y)$ of $d$ or less, so using that number of prime modular equations we can find coordinates $(x,y)$ for which $f(x,y)>d$.
