Theorem: Square and Tetrahedral Numbers

The only positive integers which are simultaneously tetrahedral and square are:
:$1, 4, 19 \, 600$

Proof:
First we confirm that these $3$ numbers have that property:
{{begin-eqn}}
{{eqn | l = 1
      | r = \dfrac {1 \paren {1 + 1} \paren {1 + 2} } 6
      | c = Closed Form for Tetrahedral Numbers
}}
{{eqn | r = 1^2
      | c = {{Defof|Square Number}}
}}
{{end-eqn}}
{{begin-eqn}}
{{eqn | l = 4
      | r = \dfrac {2 \paren {2 + 1} \paren {2 + 2} } 6
      | c = Closed Form for Tetrahedral Numbers
}}
{{eqn | r = 2^2
      | c = {{Defof|Square Number}}
}}
{{end-eqn}}
{{begin-eqn}}
{{eqn | l = 19 \, 600
      | r = \dfrac {48 \paren {48 + 1} \paren {48 + 2} } 6
      | c = Closed Form for Tetrahedral Numbers
}}
{{eqn | r = 140^2
      | c = {{Defof|Square Number}}
}}
{{end-eqn}}
{{qed|lemma}}
It remains to be shown that these are the only such instances.
Let $H_n$ be the $n$th tetrahedral number.
Let $H_n$ also be square
From Closed Form for Tetrahedral Numbers:
:$H_n = \dfrac {n \paren {n + 1} \paren {n + 2} } 6$
There are $2$ cases to consider, as follows.
=== $n$ Even ===
Let $n$ be even such that $n = 2 m$ for some $m \in \N$.
We have {{hypothesis}} that $H_n$ is both tetrahedral and square.
Hence from Parity of Integer equals Parity of its Square:
:$H_n = \dfrac {2 m \paren {2 m + 1} \paren {2 m + 2} } 6 = \paren {2 Q}^2$
where $Q$ is a natural number.
Dividing both sides by $4$:
:$\dfrac {m \paren {2 m + 1} \paren {m + 1} } 6 = Q^2$
From Sum of Sequence of Squares, we have that:
:$\ds \forall m \in \N: \sum_{i \mathop = 1}^n i^2 = \frac {m \paren {m + 1} \paren {2 m + 1} } 6$
Hence from Sums of Consecutive Sequences of Squares that equal Squares, the only $m$ such that $\dfrac {m \paren {2 m + 1} \paren {m + 1} } 6 = Q^2$ are:
:$m = 1$
and:
:$m = 24$
leading to:
:$n = 2$
and:
:$n = 48$
{{qed|lemma}}
=== $n$ Odd ===
Let $n$ be odd.
There are $3$ cases to consider:
:$(1): \quad n$ is divisible by $3$
:$(2): \quad n + 1$ is divisible by $3$
:$(3): \quad n + 2$ is divisible by $3$.
In order to make it easier for ourselves, we replace $n$ in each case with:
{{begin-eqn}}
{{eqn | n = 1
      | l = n
      | r = 6 m + 3
}}
{{eqn | n = 2
      | l = n
      | r = 6 m - 1
}}
{{eqn | n = 3
      | l = n
      | r = 6 m + 1
}}
{{end-eqn}}
for some $m \in \N$.
;Case $(1) <nowiki>:</nowiki> n = 6 m + 3$
We have:
{{begin-eqn}}
{{eqn | l = H_n
      | r = \dfrac {n \paren {n + 1} \paren {n + 2} } 6
      | c = Closed Form for Tetrahedral Numbers
}}
{{eqn | r = \dfrac {\paren {6 m + 3} \paren {6 m + 4} \paren {6 m + 5} } 6
      | c = substituting $6 m + 3$ for $n$
}}
{{eqn | r = \paren {2 m + 1} \paren {3 m + 2} \paren {6 m + 5}
      | c = dividing top and bottom by $6$
}}
{{end-eqn}}
The numbers $2 m + 1$, $3 m + 2$ and $6 m + 5$ are pairwise coprime, and so we have:
{{begin-eqn}}
{{eqn | l = 2 m + 1
      | r = x^2
}}
{{eqn | l = 3 m + 2
      | r = y^2
}}
{{eqn | l = 6 m + 5
      | r = z^2
}}
{{end-eqn}}
for some natural numbers $x, y, z$.
But then:
{{begin-eqn}}
{{eqn | l = 3 x^2 + 1
      | r = 3 \paren {2 m + 1} + 1
}}
{{eqn | r = 6 m + 4
}}
{{eqn | r = 2 y^2
}}
{{end-eqn}}
But this is impossible, because on the left hand side:
{{begin-eqn}}
{{eqn | l = 3 x^2 + 1 
      | o = \equiv
      | r = 1 \pmod 3
}}
{{end-eqn}}
while on the right hand side:
{{begin-eqn}}
{{eqn | l = 2 y^2
      | o = \equiv
      | r = 0 \text{ or } 2 \pmod 3
      | c = Square Modulo 3
}}
{{end-eqn}}
Hence it cannot be the case that $n$ is divisible by $3$.
{{qed|lemma}}
;Case $(2) <nowiki>:</nowiki> n = 6 m - 1$
We have:
{{begin-eqn}}
{{eqn | l = H_n
      | r = \dfrac {n \paren {n + 1} \paren {n + 2} } 6
      | c = Closed Form for Tetrahedral Numbers
}}
{{eqn | r = \dfrac {\paren {6 m - 1} \paren {6 m} \paren {6 m + 1} } 6
      | c = substituting $6 m - 1$ for $n$
}}
{{eqn | r = \paren {6 m + 1} m \paren {6 m + 5}
      | c = dividing top and bottom by $6$
}}
{{end-eqn}}
The numbers $6 m - 1$, $6 m$ and $6 m + 1$ are pairwise coprime, and so we have:
{{begin-eqn}}
{{eqn | l = 6 m + 1
      | r = x^2
}}
{{eqn | l = 6 m
      | r = 6 y^2
}}
{{eqn | l = 6 m + 1
      | r = z^2
}}
{{end-eqn}}
But then:
{{begin-eqn}}
{{eqn | l = x^2 + 1
      | r = \paren {6 m - 1} + 1
}}
{{eqn | r = 6 m
}}
{{eqn | r = 6 y^2
}}
{{end-eqn}}
But this is impossible, because on the left hand side:
{{begin-eqn}}
{{eqn | l = x^2 + 1 
      | o = \equiv
      | r = 1 \text{ or } 2 \pmod 3
      | c = Square Modulo 3
}}
{{end-eqn}}
while on the right hand side:
{{begin-eqn}}
{{eqn | l = 6 y^2
      | o = \equiv
      | r = 0 \pmod 3
}}
{{end-eqn}}
Hence it cannot be the case that $n + 1$ is divisible by $3$.
{{qed|lemma}}
;Case $(3) <nowiki>:</nowiki> n = 6 m + 1$
We have:
{{begin-eqn}}
{{eqn | l = H_n
      | r = \dfrac {n \paren {n + 1} \paren {n + 2} } 6
      | c = Closed Form for Tetrahedral Numbers
}}
{{eqn | r = \dfrac {\paren {6 m + 1} \paren {6 m + 2} \paren {6 m + 3} } 6
      | c = substituting $6 m + 1$ for $n$
}}
{{eqn | r = \paren {6 m + 1} \paren {3 m + 1} \paren {2 m + 1}
      | c = dividing top and bottom by $6$
}}
{{end-eqn}}
The numbers $6 m + 1$, $6 m + 2$ and $6 m + 3$ are pairwise coprime, and so we have:
{{begin-eqn}}
{{eqn | l = 6 m + 1
      | r = x^2
}}
{{eqn | l = 6 m + 2
      | r = 2 y^2
}}
{{eqn | l = 6 m + 3
      | r = 3 z^2
}}
{{end-eqn}}
But then:
{{begin-eqn}}
{{eqn | l = x^2 + 1
      | r = \paren {6 m + 1} + 1
}}
{{eqn | r = 6 m + 2
}}
{{eqn | n = 1
      | r = 2 y^2
}}
{{end-eqn}}
{{begin-eqn}}
{{eqn | l = 2 y^2 + 1
      | r = \paren {6 m + 2} + 1
}}
{{eqn | r = 6 m + 3
}}
{{eqn | n = 2
      | r = 3 z^2
}}
{{end-eqn}}
{{begin-eqn}}
{{eqn | l = x^2 + 2
      | r = \paren {6 m + 1} + 2
}}
{{eqn | r = 6 m + 3
}}
{{eqn | n = 3
      | r = 3 z^2
}}
{{end-eqn}}
and so:
{{begin-eqn}}
{{eqn | l = 3 z^2
      | r = 4 y^2 - x^2
}}
{{eqn | r = \paren {2 y + x} \paren {2 y - x}
}}
{{end-eqn}}
We note that:
{{begin-eqn}}
{{eqn | l = \paren {2 y + x} + \paren {2 y - x}
      | r = 4 y
}}
{{eqn | l = \paren {2 y + x} - \paren {2 y - x}
      | r = 2 x
}}
{{end-eqn}}
These have no common divisor except $2$.
But $x$ is odd and so no such common divisor actually exists.
Hence $\paren {2 y + x}$ and $\paren {2 y - x}$ are coprime.
Hence we can set:
{{begin-eqn}}
{{eqn | l = z
      | r = p q
}}
{{eqn | l = 2 y + x
      | r = 3 p^2
}}
{{eqn | l = 2 y + x
      | r = q^2
}}
{{end-eqn}}
From $(1)$, $(2)$ and $(3)$, we get:
:$9 p^4 - 18 p^2 q^2 + q^4 + 8 = 0$
Solving for $p^2$ using the Quadratic Formula:
{{begin-eqn}}
{{eqn | l = p_2
      | r = q^2 \pm \dfrac 2 3 \sqrt {2 \paren {q^4 - 1} }
      | c = 
}}
{{eqn | r = q^2 \pm \dfrac 2 3 \sqrt {2 \paren {q^2 + 1} \paren {q^2 - 1} }
      | c = 
}}
{{eqn | r = q^2 \pm \dfrac 2 3 \sqrt {2 \paren {q^2 + 1} \paren {q + 1} \paren {q - 1} }
      | c = 
}}
{{end-eqn}}
The factors under the square root sign can have no common divisor except $2$.
But $q$, like the divisor of the odd $z$, is likewise odd.
We can put the square root into the form:
:$\sqrt {16 \times \dfrac {q^2 + 1} 2 \times \dfrac {q^2 - 1} 4}$
of which the factors $\dfrac {q^2 + 1} 2$ and $\dfrac {q^2 - 1} 4$ are coprime.
Because $p^2$ is rational, it is necessary that the expression under the square root sign is a square.
The first case is impossible, because $q^2 - 1$ is never square.
The second case is possible only when $q^2 = 1$.
It follows that the only possible solution is where:
:$p^2 = q^2 = 1$
and so:
:$x = y = z = 1$
leading to:
:$n = 1$
{{qed|lemma}}
The result follows by Proof by Cases.
{{qed}}