# Density of Ratios of Triangular Numbers on [0,1] Interval

I'm trying to prove that the ratio of triangular numbers is dense on the interval from 0 to 1. More precisely, given $l\in[0,1]$ and $\varepsilon>0$, we can find $m,n \in \mathbb{N}$ so that $|\frac{m(m+1)}{n(n+1)}-l|<\varepsilon$.

I came up with an algorithm that seems to work, but I don't know how a proof would look.

Suppose $\varepsilon>0$ and $l\in[0,1]$ are given. Then use the following algorithm to determine $m$ and $n$:

Set $m_0=1$ and $n_0=2$.

Set $k=0$.

while $|\frac{m_k(m_k+1)}{n_k(n_k+1)}-l| \geq \varepsilon$

{

if $\frac{m_k(m_k+1)}{n_k(n_k+1)}<l$ and $n_k-m_k > 1$

Set $m_{k+1}=m_k+1$ and $n_{k+1}=n_k$

if $\frac{m_k(m_k+1)}{n_k(n_k+1)}>l$

Set $m_{k+1}=m_k$ and $n_{k+1} = n_k+1$

Otherwise:

Set $m_{k+1}=m_k+1$ and $n_{k+1}=n_k+1$

$k = k+1$

}

This seems to work. Could the algorithm be rewritten as a proof using the nested interval theorem? If so, I'm having a hard time seeing how. The idea would be to use the Archimedean principal to find a triangular ratio $p_0$ with $p_0<l$ and a triangular ratio $q_0$ with $q_0>l$. Then created a sequence of nested intervals $I_n$ such that $I_n=[p_n,q_n]$ where $p_n$ is an increasing sequence of triangular ratios, and $q_n$ is a decreasing sequence of triangular ratios. Further, for any $I_k$, $I_{k+1}\subseteq I_k$.

-
I should clarify a bit about where $\frac{m(m+1)}{n(n+1)}$ came from. Triangular numbers are of the form $1+2+3+...+n$, which evaluates to $\frac{n(n+1)}{2}$. If we divide one triangular number by another, we get a number of the form $\frac{m(m+1)}{n(n+1)}$ – objectivesea Mar 13 '12 at 7:30
You will find that $| l-\frac{m_k(m_k +1) }{n_k(n_k +1)} | \le \frac{2}{n_k}$, which will meet your needs – Henry Mar 13 '12 at 8:11
@Henry Hammering this out would make a great answer, since it specifically addresses the OP's algorithm. – WimC Mar 13 '12 at 8:33
@WimC: Feel free to do so - I am happy with joriki's answer – Henry Mar 13 '12 at 8:52

These ratios are dense because the triangular numbers grow quadratically while their differences grow linearly. We can solve $m(m+1)=n(n+1)l$ for $m$ to give

$$m=-\frac12+\sqrt{\frac14+n(n+1)l}$$

and then consider the triangular numbers for $\def\fm{\lfloor m\rfloor}\fm$ and $\def\cm{\lceil m\rceil}\cm$. We have

$$\frac{\fm(\fm+1)}{n(n+1)}\le l\le\frac{\cm(\cm+1)}{n(n+1)}\;,$$

so the distance of these ratios from $l$ is not more than the distance between them, which is

$$\begin{eqnarray} \frac{\cm(\cm+1)-\fm(\fm+1)}{n(n+1)} &\le& \frac{\cm(\cm+1)-(\cm-1)\cm}{n(n+1)} \\ &=&\frac{2\cm}{n(n+1)}\;, \end{eqnarray}$$

which goes to zero as $n$ goes to infinity.

-
Nice. In general $\lceil m \rceil \leq \lfloor m \rfloor + 1$, so you only get an upper bound for the difference. – WimC Mar 13 '12 at 8:23
@WimC: Thanks, I've correct that. – joriki Mar 13 '12 at 8:26

Let $(p_k/q_k)$ be a sequence of rationals in $(0,1)$ converging to $\sqrt{x}\in[0,1]$. We can show that $$\large \lim_{k\to\infty}\frac{T_{k\times p_k}}{T_{k\times q{}_k}}=x.$$

(We augment by $k$ to account for the possibility that $q_k\not\nrightarrow\infty$.)

-
Adding some more detail would help. You could also use $\tfrac{p_k}{k} \rightarrow \sqrt{x}$ and avoid the factor $k$. – WimC Mar 13 '12 at 8:57