Knowing that $f(n)=n$, $g(n)=n\sqrt3$. Find $h(n)$ that contains all elements of $f(n)$ and $g(n)$ in ascending order. Knowing that:

*

*$n$ is an integer going from zero to infinity,


*$f(n)=n$,


*$g(n)=n\sqrt3$.
I need a formula for $h(n)$ that can generate the series: $0, 1, \sqrt3, 2, 3, 2\sqrt3, 4, 5, 3\sqrt3, 6, 4\sqrt3 ... $ as a function of $n$.
$h(n)$ is a series that contains all elements of $f(n)$ and $g(n)$ in ascending order.
 A: You don't want the formula; it is going to be ugly.
.
.
.
.
.
.
Well, you've been warned. Have it, then:
$$h(n) = \min\left(\sqrt3\left\lceil{n\over1+\sqrt3}\right\rceil,\left\lceil{n\sqrt3\over1+\sqrt3}\right\rceil\right)$$
where $\lceil\cdot\rceil$ is of course the ceiling function.
A: This is not an answer to the question, but I did want to add a fun fact about the sequence. If you center a circle on a point in a triangular lattice, then this sequence describes the length of all possible radii in which the boundary of the circle touches only six points.
A: The indices when roots appear seems to be oeis.org/A054088
Based on this I propose the following:

*

*$\phi(n)=n+\lfloor(n\sqrt{3})\rfloor\qquad$ the indices of $x\sqrt{3}$ numbers


*$\Phi(n)=\lceil\frac n{1+\sqrt{3}}\rceil\qquad$ the $x$ before $\sqrt{3}$, i.e. $\phi^{-1}$


*$\delta(n)=\Phi(n+1)-\Phi(n)\in\{0,1\}\qquad$ indicates that this $n$ is a root


*$N(n)=n+1-\Phi(n)\qquad$ the natural numbers mingled between the roots
The resulting formula:
$$h(n):\begin{cases}N(n)&\quad&\delta(n)=0\\\Phi(n)\sqrt{3}&&\delta(n)=1\end{cases}$$
Or without piecewise selection $h(n)=\delta(n)\Phi(n)\sqrt{3}+(1-\delta(n))N(n)$
