19
$\begingroup$

Which natural numbers can be written as the ratio of two triangular numbers?

That is, which natural numbers can be written as

$$\frac{n(n+1)}{m(m+1)}$$ for natural numbers $m,n$.

$\endgroup$

3 Answers 3

15
$\begingroup$

Any non-square $d$ can be written in this way. We need to solve $n(n+1)=dm(m+1)$, and multiplying by 4 and setting $a=2n+1$, $b=2m+1$ we get

$$a^2-db^2=1-d$$

and we need to solve this in odd integers $a$ and $b$ other than $a,b=\pm1$ (which give division by zero when we sub back). But we can do this -- $a=1$ and $b=1$ is one solution, and if we choose a unit $u>1$ in $R=\mathbf{Z}[\sqrt{d}]$ congruent to 1 mod $2R$ (such a thing exists by general theory) then $(1+\sqrt{d})u=a+b\sqrt{d}$ gives a solution congruent to 1 mod $2R$ and hence $a$ and $b$ are odd giving us a solution to the original question.

Here's an example: set $d=97$. Then $u=62809633+6377352\sqrt{97}$ is a unit congruent to 1 mod 2, and $(1+\sqrt{97})(62809633+6377352\sqrt{97})=681412777+69186985\sqrt{97}$ giving $n=340706388$ and $m=34593492$. This probably isn't the smallest solution but on the other hand it was easy to generate because pari can compute units in real quadratic fields super-quickly.

For $d$ a square it seems a bit more delicate. Say $d=r^2$. If $r=2$ mod 4 then $n=(r^2-4)/4$ and $m=(r-2)/4$ works so this gives a solution for $d=6^2,10^2,14^2\ldots$. But in the remaining cases there might not be a simple criterion -- the question seems to involve (amongst other things) factorizing $r^2-1$ into two factors other than $r+1\times r-1$ but whose sum is $2r$ mod $4r$, and this is perhaps the sort of thing that can be done sometimes but can't be done sometimes. For example $35^2-1=6\times 204$ and (omitting the details, which are not hard) this yields $n=49$ and $m=1$. A computer search for such factors shows that $d^2$ can be written as a ratio of triangular numbers for $d=35,99,195,204,323,483,675,899,980,1155,\ldots$ and the $2$ mod $4$ cases.

$\endgroup$
13
  • $\begingroup$ Do you mean squarefree? Gerhard "Always Unsure Before Having Coffee" Paseman, 2011.07.01 $\endgroup$ Jul 1, 2011 at 18:35
  • $\begingroup$ $\mathbb{Z}[\sqrt{d}]$ has nontrivial units for any positive non-square integer $d$; it doesn't have to be squarefree. $\endgroup$ Jul 1, 2011 at 18:36
  • 1
    $\begingroup$ Gerhard: for any square $d=r^2$ it's a finite problem. Writing $a=2n+1$ and $b=2m+1$ one needs to solve $(rb+a)(rb-a)=r^2-1$ so one just looks through all the factors of $r^2-1$ and sees whether they yield odd integers for $a$ and $b$ with the caveat that $b$ can't be $\pm1$. Trying this with $r=2$ gives four factorizations all of which give odd integers for $a$ and $b$ but unfortunately $b=\pm1$ every time. So no solution for $d=4$. $\endgroup$ Jul 1, 2011 at 19:12
  • 1
    $\begingroup$ Basic observation: Suppose that $r-1$ and $r+1$ are prime, with $r \equiv 0 \mod 4$. Then I claim $r^2$ is not such a ratio. Proof: In your notation, we would have $(rb-a)(rb+a)=(r-1)(r+1)$. So either $(rb-a, rb+a)$ is $(r-1, r+1)$ or it is $(1, r^2-1)$. In the first case, $a=1$, which doesn't count. In the second, $b = r/2$, which is even and hence useless. It is generally expected there should be infinitely many twin primes of this form, so there should be infinitely many ratios that don't occur. (Thanks to Kevin for pointing out errors in an earlier version of this comment.) $\endgroup$ Jul 1, 2011 at 19:44
  • 1
    $\begingroup$ @David: I had the same observation, then I played with Chen's theorem (substitute for twin primes). Finally I realized that we don't need that $r+1$ is prime, see my response below. $\endgroup$
    – GH from MO
    Jul 1, 2011 at 20:22
12
$\begingroup$

Kevin already finished the non-square part. Suppose $$\frac{m(m+1)}{n(n+1)}=k^2$$ then denoting $x=2m+1,y=2n+1$, we get the form $$k^2-1=(ky-x)(ky+x).$$ So there is an integer $a$ so that $ky-x=a, ky+x=\frac{k^2-1}{a}$, in particular $$2y=\frac{k^2+a^2-1}{ka}\in \{6,10,14,\dots\}=S$$ because $y$ is odd and $>1$. It is easy to show that this happens if only if $(a,k)$ are consecutive terms in the sequence $$a_0=1,a_1=2y,a_{n+1}=2ya_n-a_{n-1}.$$ So $k^2$ is the ratio of two triangular numbers iff $$k\in \bigcup_{m\in S}\{1,m,m^2-1,m^3-2m,\dots\}$$ where $S$ consists of all numbers $2\pmod{4}$ that are greater than $2$.

$\endgroup$
3
  • $\begingroup$ Same trick as in mathoverflow.net/questions/68506/… $\endgroup$ Jul 1, 2011 at 19:27
  • $\begingroup$ I definitely need a bigger screen. Thanks yet again. Gerhard "Ask Me About System Design" Paseman, 2011.07.01 $\endgroup$ Jul 1, 2011 at 19:43
  • 1
    $\begingroup$ This looks dead right -- I could see in my computer output that the answers were falling into infinitely many families but I figured I'd done enough (and I had to put the kids to bed!). Thanks Gjergji. Isn't it a funny question? My first thought was that it was homework because the non-square case is a simple consequence of "Pell theory" or whatever it's called... $\endgroup$ Jul 1, 2011 at 20:01
3
$\begingroup$

A small complement to the nice answers so far: there are infinitely many squares that are not the ratio of two triangular numbers.

Indeed, with Gjergji Zaini's notation, let $k=p+1$, where $p\equiv 3\pmod{4}$ is a prime. Then the equation $$k^2-1=(ky-x)(ky+x)$$ becomes $$p(p+2)=((p+1)y-x)((p+1)y+x).$$ The first factor on the right is at most $p$, hence if $p$ divides this factor, then the factors on the right are $p$ and $p+2$, so that $y=1$, which corresponds to $n=0$. If $p$ divides the second factor on the right, then the factors on the right are $q$ and $pr$ such that $qr=p+2$. Now $$q-r\equiv q+pr=2(p+1)y\equiv 0\pmod{p+1},$$ hence $|q-r|\geq p+1$, which forces $q=1$ and $r=p+2$ (since $1\leq q\leq p$). In other words, the factors on the right are $1$ and $p(p+2)$, so that $y=(p+1)/2$. The last expression is even, hence it does not correspond to any $n$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.