What is the series of numbers, where each number is a triangular, square, and hexagonal number?

784 Views Asked by At

I'm looking for a list of numbers. Every number in the list must be triangular, square, and hexagonal.

As it turns out, every hexagonal number is also a triangular number. So my question is equivalent to a list of numbers where each one is square and hexagonal.

I took a look at the first few hexagonal numbers:

1, 6, 15, 28, 45, 66, 91, 120, 153, 190, 231, 276, 325, 378, 435, 496, 561, 630, 703, 780, 861, 946, ...

I do not recognize any perfect squares in there. Does my list exist?

I of course also took a look at the formula for hexagonal numbers:

$$H_n = 2n^2 - n$$

However, we are not trying to make an $n^2$ out of this. $n$ in this formula represents the nth hexagonal number. We just want the formula to equal the square of some integer, any integer. In other words we want:

$$2n^2 - n = x^2$$ where $x$ and $n$ are any positive integers. I say positive integers to exclude the trivial case of $x = n = 0$. I'm not sure if zero can be considered square and hexagonal numbers, depending on the exact definition. (There was even an argument that zero was prime, because if not, then it must be composite, and what are the factors of zero? It all depends on precise definitions.)

Anyway, the equation $2n^2 - n = x^2$ cannot be solved for what I'm looking for in the normal way. The best I can do is say $x = \sqrt{2n^2 - n}$ and wonder if any $2n^2 - n$, where n is integer, is a perfect square? (That is basically the same thing as the original equation, wondering if it's a perfect square.)

2

There are 2 best solutions below

7
On

Using the common method for solving the quadratic equation $2n^2-n-x^2=0$ yields

$$n=\frac{1\pm\sqrt{1+8x^2}}{4}$$

Of course, since $n$ is positive, we'll take the positive sign.

For $n$ to be an integer in the equality above, $1+8x^2$ must be itself a perfect square, say $k^2$. Moreover, we must have $k\equiv 3\pmod4$ for the numerator to be divisible by $4$. The equation then becomes

$$k^2-8x^2=1$$

and this is a well known kind of diophantine equation, the Pell equation.

The fundamental solution $(k_1,x_1)$ is $(3,1)$, obtained from the convergents of the continued fraction for $\sqrt{8}=[2;\overline{1,4}]$. All other solutions $(k_i,x_i)$ can be otained via the recursion

\begin{align} k_{i+1}&=k_1k_i+8x_1x_i=3k_i+8x_i\\ x_{i+1}&=k_1x_i+x_1k_i\hphantom{8}=3x_i+k_i \end{align}

Now, not all solutions here are good for us, because of the modulo $4$ constraint on $k$. Indeed, we see that $(k_2,x_2)=(17,6)$ is no good for us, but $(k_3,x_3)=(99,35)$ is.

The recursion implies that $k_{i+1}\pmod4\equiv3k_i$. Since $k_1\equiv3\pmod4$, it follows that $k_{2j}\equiv1\pmod4$ and $k_{2j+1}\equiv3\pmod4$. In other words, only the odd terms of the recursion will be of use to us.

This way, we find the first few pairs $(k,x,n)$:

\begin{array}{c|c|c} k&x&n\\ \hline 3&1&1\\ 99&35&25\\ 3363&1189&841\\ 114243&40391&28561\\ 3880899&1372105&970225\\ \hline \end{array}

Of course, there are infinitely many solutions.


EDIT: We may use linear algebra to solve the recursion. Indeed the system can be written as

$$ \pmatrix{k_{i+1}\\x_{i+1}}=\underbrace{\pmatrix{3&8\\1&3}}_A\pmatrix{k_i\\x_i}. $$

Noticing that $\pmatrix{k_1\\x_1}=A\pmatrix{1\\0}$, it follows that

$$ \pmatrix{k_i\\x_i}=A^i\pmatrix{1\\0}. $$

We may diagonalize $A$ to find that $A=PDP^{-1}$, where

\begin{align} P=\pmatrix{-2\sqrt{2}&2\sqrt{2}\\1&1}&& D=\pmatrix{3-2\sqrt{2}&0\\0&3+2\sqrt{2}}&& P^{-1}=\pmatrix{-\frac{\sqrt{2}}8&\frac12\\\frac{\sqrt{2}}8&\frac12} \end{align}

so that finally

$$ \pmatrix{k_i\\x_i} =\pmatrix{\frac12\Big({(3+2\sqrt{2})}^i+{(3-2\sqrt{2})}^i\Big)\\\frac{\sqrt2}8\Big({(3+2\sqrt{2})}^i-{(3-2\sqrt{2})}^i\Big)} =\pmatrix{\Big\lceil\frac12{\left(3+2\sqrt{2}\right)}^i\Big\rceil \\ \Big\lfloor\frac{\sqrt{2}}8{\left(3+2\sqrt{2}\right)}^i\Big\rfloor} $$

But remember, we're only interested in odd $i$. The corresponding $n_i$ is given by

$$n_i=\frac14\left(1+\sqrt{1+\left\lfloor\frac14{\left(3+2\sqrt{2}\right)}^{2i}\right\rfloor}\right)$$

2
On

First some examples: $$H_1=1=1^2,\, H_{25}=1225=35^2,\, H_{841}=1413721=1189^2,\, H_{28561}=1631432881=40391^2$$ and so on.

The equation is $2n^2-n=x^2$. Multiply by $8$ we have $$16n^2-8n=8x^2\implies (4n-1)^2-8x^2=1$$ Let $a=4n-1$ and $b=2x$ we get the equation $$a^2-2b^2=1$$ which is a simple pell equation. Each solution $(a,b)$ of this equation implies corresponding $(n,x)$.