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
:
namely .
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
Sweet.
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
.]

3 comments
Comments feed for this article
October 1, 2008 at 3:52 pm
David Speyer
I’m way to lazy to work out the details right now, but: the equations you are dealing with are a pair of quadratic equations in three variables. That means they probably cut out an elliptic curve. Assuming this is correct, we know from Siegel’s Theorem that there are only finitely many integral points.
October 1, 2008 at 9:27 pm
Todd Trimble
Thank you, David! Assuming there are only finitely many integral solutions (which is the case under the weaker assumption that the genus of the curve is greater than zero), I’ll bet people have also developed upper bounds which tell how far one needs to look for solutions, so maybe the problem could be put to rest with the help of a computer.
As an ignoramus about this sort of thing, let me ask out of curiosity: how did you happen to know this fact about two quadratics in three unknowns? Is there some way of predicting (in some generic sense) the genus of a curve defined by n-1 equations in n unknowns, based on superficial information like the degrees of the equations?
October 1, 2008 at 11:09 pm
David Speyer
To be honest, I knew that one by heart. But it isn’t hard to work out. If you have generic hypersurfaces of degrees d_1, d_2, d_3 … d_{n-2} in P^{n-1}, and their intersection is X, then generically you expect the sequence
0 <– O_X <– \bigoplus O(-d_i) \to \bigoplus O(-d_i – d_j) \to … \to O(-d_1-d_2-…-d_{n-2}) <– 0
to be exact.
Taking Hilbert series, you expect the Hilbert series of X to be
(1-t^{d_1}) (1-t^{d_2}) … (1-t^{d_{n-2}}) / (1-t)^n. (*)
Now, we know that the Hilbert polynomial of a curve of degree D and genus G is D(n+1)-(D+G-1) (by Riemmann-Roch) so the Hilbert series is
D/(1-t)^2 – (D+G-1)/(1-t) + polynomial(t). (**)
So we want to match up terms in equations (*) and (**).
In our example, it looks like this: (*) is
(1-t^2)^2/(1-t^4) = (1+2t+t^2)/(1-t)^2=(4-4(1-t)+(1-t)^2)/(1-t)^2
=4/(1-t)^2 – 4/(1-t) + 4
So D=4 and D+G-1=4, so G=1.
I don’t feel like working out the general case, but you should be able to. I also think this might be an exercise in Hartshorne, but I don’t have my book on me.