Least upper bound on $x_n = \min{|a - b\sqrt{3}| : a + b = n}$. For all integers $n \geq 1$, define $x_n = \min{|a - b\sqrt{3}| : a + b = n}$ where $a$ and $b$ are positive integers.
Find the smallest positive real number p such that $x_n \leq p$ for all $n \geq 1$.
This problem is problem 1.6.9 from Problems in Analysis : Advanced Calculus on the Real Axis by Teodora-Liliana Radulescu, Vicentiu Radulescu, and Titu Andreescu.
I tried looking at $|a - b\sqrt{3}| = |b||\frac{a}{b}-\sqrt{3}|$ and $|a - b\sqrt{3}|^2=|a^2 - 2ab\sqrt{3}+3b^2|$, but this doesn't seem to get me anywhere.
Any hints would be appreciated.
 A: Let $x=\sqrt 3+1, x \in (2,3)$ so $x_n=\min |n-bx|, 1 \le b \le n-1$. Let $f_n(y)=f(y)=|n-yx|, 1 \le y \le n-1$.
If we choose $b_1=[n/x], b_2=[n/x]+1$ we have that (for $n \ge 10$ say so $b_1,b_2 \in [1, n-1]$) $b_1x < n <b_2x$ so $f(b_1)+f(b_2)=x$ hence $x_n = \min (f(b_1), f(b_2)) \le x/2$
(since $f_n$ attains it's minimum at $n/x$ and is monotonic on each of the intervals $[1,n/x]$ and $[n/x, n-1]$ it follows that indeed $x_n$ is attained at either $[n/x]$ or $[n/x]+1$)
But now since $1/x$ is irrational, we have that $n/x$ is equidistributed modulo $1$ hence for every $\epsilon >0$ there are infinitely many $n$ st $0 < n/x-[n/x] -1/2 \le \epsilon$.
Hence $f_n([n/x])=x(n/x-[n/x]) \in [x/2, x/2+x\epsilon]$ which shows that for those $n$ we have that $f_n([n/x]+1)=x-f_n([n/x]) \ge x/2-x\epsilon$, hence $x_n =\min (f_n([n/x]), f_n([n/x]+1)) \ge x/2-x\epsilon$.
Since $\epsilon$ is arbitrary this gives that $\sup x_n =x/2=\frac{1+\sqrt 3}{2}$ as guessed
Note that as mentioned in the comments for small $n$ it may be that $n/x<1$ so one of the $b$ used to prove the result is not valid being $0$ But here this happens only for$n=2$ and there we check that indeed $|2-x|$ which is the only value hence the min by default is indeed less than $(1+x)/2$ since $x<3$ so we are good
