It’s been quite a while since I’ve posted anything; I’ve been very busy with non-mathematical things this past month, and probably will be for at least another few weeks. In the meantime, I’d been idly thinking of another Problem of the Week to post, and while I was thinking of one such problem… I got stuck. So instead of just baldly posing the problem, this time I’ll explain how far as I got with it, and then ask you all for help.
The problem is easy to state: except for 1, are there any positive integers which are simultaneously triangular, square, and pentagonal numbers?
Just asking for all numbers which are simultaneously triangular and square is a fun little exercise in number theory, involving Pell’s equation and (yes) continued fractions. I’ll sketch how this goes. We are trying to solve the Diophantine equation
By completing the square and manipulating a little, we get
This converts to a Pell equation where , . Writing the Pell equation as
and using the fact that the norm map just defined is a multiplicative homomorphism (because the Galois automorphism is also multiplicative), we see that the set of solutions
forms a group, under the group multiplication law
which is read off just by expanding . The right branch of the hyperbola thus forms a group (under this multiplication law, with identity ) which is isomorphic to the additive group of real numbers. The set of integer solutions sitting on this branch forms a discrete subgroup, and hence is isomorphic to the additive group of integers (provided that nontrivial solutions exist!). To find a generator of this group, just look for the integer solutions to which come closest to the identity ; they are .
So, generates the set of positive integer solutions. The next is
and in general, the solutions are given recursively by
Let’s go back a minute to our original problem, which asked for numbers which are both triangular and square. We read off the triangle-square, , from . For example,
and so the square is simultaneously the triangular number . From , we have , and so is the next triangle-square. The next after that is . And so on.
It would be nice to express these solutions in closed form. To this end, let me observe that the quotients are rational approximants to the continued fraction of :
(A similar observation applies to any Pell equation: positive solutions to , where is square-free, can be read off by examining every other rational approximant to the continued fraction for . This, I find, is a very cool fact.)
Starting from the first two rational approximants , the remaining approximants can be read off from the recursive rule (*)
and for the purpose of determining the triangle-squares, we are really interested only in every other one of the denominators , that is to say, . We can get a recursive rule for these from
where the last equation follows easily from the recursive rule (*). The same recursion thus gives the and :
To get a closed form for the (whose squares are triangular), we can now apply the familiar method of generating functions (see here for a worked example of this method to derive the closed form for the Fibonacci numbers). Form
and use the recursive rule for the to deduce (after some manipulation) that
The denominator expands as ; by the method of partial fractions, we obtain
and from there, expanding the preceding line in geometric series, we derive a closed form for the :
Nice! If you prefer, this is just the integer part of .
So, the triangular square is
Having gone through this analysis, the same method can be used to determine those squares which are pentagonal (the first few pentagonal numbers are ). I’ll let readers work this out if they like; suffice it to say that the square which is also pentagonal is the square of
And that’s about as far as I got with this. After trying a few numerical forays with a hand-held calculator, my gut feeling is that I’d be amazed if there were any triangular-square-pentagonals past . But can anyone clinch the case?
[Edit: I’ve corrected the exponents in the last displayed line, from to .]