<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{graphicx}
\usepackage{enumitem}

\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}

\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}

\usepackage{color}
\usepackage{fullpage}
\usepackage{float}

\usepackage{psfig}
\usepackage{graphics}
\usepackage{latexsym}
\usepackage{epsf}
\usepackage{breakurl}

\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.1in}
\setlength{\textheight}{8.4in}

\newcommand{\seqnum}[1]{\href{https://oeis.org/#1}{\rm \underline{#1}}}
\def\modd#1 #2{#1\ \mbox{\rm (mod}\ #2\mbox{\rm )}}

\begin{document}

\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}

\begin{center}
\vskip 1cm{\LARGE\bf Triangular Numbers With a \\
\vskip .1in
Single Repeated Digit
}
\vskip 1cm
\large
Christian Hercher\\
Institut f\"{u}r Mathematik\\
Europa-Universit\"{a}t Flensburg\\
Auf dem Campus 1c\\
24943 Flensburg\\
Germany \\
\href{mailto:christian.hercher@uni-flensburg.de}{\tt christian.hercher@uni-flensburg.de} \\
\ \\
Karl Fegert\\
Neu-Ulm\\
Germany\\
\href{mailto:karl.fegert@arcor.de}{\tt karl.fegert@arcor.de} \\
\end{center}

\vskip .2 in
\begin{abstract}
The question of which triangular numbers have a decimal representation containing a single repeated digit seemed to be settled since at least the 1970s: Ballew and Weger provided a complete list and a proof that those are the only numbers of that kind. This assertion is referenced by other authors in the field. However, their proof is flawed. We present a new and elementary proof of the statement, which corrects the error.
\end{abstract}

\section{Introduction}

The study of triangular numbers---integers of the form $\frac{k(k+1)}{2}$---is a long-standing and well-researched area within the field of number theory. For example, Gau\ss{} proved in his {\it Disquisitiones Arithmeticae} \cite{Gauss} that every positive integer can be expressed as the sum of three triangular numbers.

A question that arises is that of
the decimal representation of triangular numbers. In particular, which triangular numbers can be expressed using a single digit? That is to say, are there triangular numbers of the form $d\cdot \frac{10^i-1}{9}$ with some digit $d\in\{1,\dots,9\}$ and positive integer~$i$? One instance of this question being posed is Problem~15648  in the {\it Educational Times} \cite{Escott}, which was proposed by Youngman and subsequently answered by Escott in the same journal. However, Escott only demonstrated the non-existence of triangular numbers with repeated 
digits exceeding $666$, comprising a maximum of $30$ digits, do not exist.

Subsequently, Ballew and Weger \cite{Ballew}  presented an erroneous proof for the following theorem.

\begin{theorem}\label{Thm:main}
The only triangular numbers whose decimal representations consist of a single repeated digit are $1, 3, 6, 55, 66,$ and $666$. 
\end{theorem}

In a recent contribution,  Kafle, Luca, and Togb\'e \cite{Kafle} generalized the problem to include repeating blocks with two digits: the only triangular numbers whose decimal representation can be written using only one block of two digits are $10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 5050,$ and $5151$. However, for the original problem, they just cite the work of Ballew and Weger.

Recently, on the internet platform MathOverflow \cite{MO}, a discussion regarding this topic was held. In this discussion, the error in Ballew and Weger's proof of Theorem~\ref{Thm:main} was identified, and a proof using the methods of elliptic curves was presented. In this paper, we provide an elementary proof of Theorem~\ref{Thm:main} using only Pell equations.

\subsection{Outline}
In accordance with the methodology proposed by Escott, Ballew, and Weger, we initially reformulate the problem. Subsequently, we provide a concise account of the erroneous assertion present within the proof of Ballew and Weger. In Section~\ref{Sec:Proof}, a proof is provided for each remaining digit, demonstrating that there are no further triangular numbers consisting of a single repeated digit.
 
\section{Reduction and reformulation of the problem}
For every positive integer $k$ let $T_k$ denote the $k$'th triangular number. In accordance with Escott's approach and the valid part of Ballew's and Weger's paper, we arrive at the following conclusion: if the decimal expression of $T_k$ 
consists solely of the single repeated digit $d$, we have
\begin{align*}
T_k&amp;=\frac{k(k+1)}{2}=d\cdot \frac{10^i-1}{9}, i\geq 1, d\in\{1,\dots,9\}\\
&amp; \iff \\
(2k+1)^2&amp;=4k^2+4k+1=8d\cdot \frac{10^i-1}{9}+1.
\end{align*}

A solution $(k, d, i)$ in positive integers for the original problem exists, if and only if the quantity $D:=1+8d\cdot \frac{10^i-1}{9}$ is a perfect square.

 From the previous line, we see that $D$ satisfies the congruence $D \equiv \modd{1+8d} {10}$. Thus, immediately, we can rule out $d \in\{ 2, 4, 7, 9\}$, because in those cases $D$ would be congruent $7$ or $3$ modulo $10$, which are not quadratic residues. Therefore, the value of $d$ must be $1, 3, 5, 6,$ or $8$. Now we look at these cases one by one:

\begin{itemize}[align=left]
\item[$d = 1$:] If $i=1$, it follows that $D=8 \cdot \frac{10^i-1}{9}+1=9=3^2$, which yields $T_1 = 1$, and for $i&gt;1$, we have $D = 88\cdots89$.

\item[$d = 3$:] If $i=1$, then $D=24 \cdot \frac{10^i-1}{9}+1=25=5^2$, which yields $T_2 = 3$. Otherwise, we have $D = 26\cdots65$.

\item[$d = 5$:] If $i=1$, we have $D=40 \cdot \frac{10^i-1}{9}+1=41$. For $i=2$, we get $D=441=21^2$, which yields $T_{10} = 55$, and for $i&gt;2$, it follows that $D = 44\cdots41$.

\item[$d = 6$:] If $i=1$, $2$, or $3$, then $D=48 \cdot \frac{10^i-1}{9}+1=49=7^2$, $D = 529 = 23^2$, or $D = 5329 = 73^2$, which yields $T_3 = 6, T_{11} = 66$, and $T_{36} = 666$. If $i&gt;3$, we have $D = 53\cdots329$.

\item[$d = 8$:] If $i=1$ or $2$, then $D=64 \cdot \frac{10^i-1}{9}+1=65$ or $D=705$. Otherwise, $D = 71\cdots105$. 
\end{itemize}

Since $\cdots05$ and $\cdots65$ cannot be the last two digits of a square number, we can exclude $d = 8$ and $d = 3$, except for $T_2$.

\subsection{The false statement}
Ballew and Weger incorrectly asserted that there is no integer $z$ whose square ends in $\cdots88889$. This assertion is, however, erroneous. For example, $8072917^2 = \cdots88888889$. In fact, since $z^2 \equiv \cdots88889 \equiv 1+8 \cdot \frac{10^{k+1}-1}{10-1}\equiv\modd{1 - \frac{1}{9}} {10^k}$ is equivalent to $9z^2-1 \equiv (3z-1)(3z+1) \equiv \modd{0} {10^k}$, there are solutions for every $k$; for example, $z=\cdots3333$. Consequently, there are square numbers whose last digits are $\cdots8889$ with an arbitrary number of $8$'s.

\section{A proof using Pell's equations}\label{Sec:Proof}
This section introduces a new line of reasoning, which rules out the remaining cases, namely those with $d \in \{1,5,6\}$.

\subsection{The case $d=1$}
In this case, we have to find all positive integers $p, i$ with
\[p^2=88\cdots89=8\cdot \frac{10^i-1}{9}+1 \iff (3p)^2-(8\cdot 10^i)=1.\]
Assuming there is a solution for $i \geq 2$ (the case $i = 1$ leads to $T_1$). Then we can make a case distinction by using the parity of $i$.
\begin{itemize}[align=left]
\item[Case A:] $i$ is even, i.e., $i = 2r$, $r\in\mathbb{N}$. Subsequently, we have 
\begin{align}
(3p)^2-2\cdot(2\cdot10^r)^2 &amp;= 1, \notag 
\intertext{and we can seek solutions to the Pell equation}
x^2-2y^2 &amp;= 1 \label{eq1}
\end{align}
 with the requirements $x = 3p$, $y = 2\cdot 10^r$, and $r \geq 1$. Thus, $y$ must satisfy $y \equiv \modd{0} {5}$ and $y \not\equiv \modd{0} {7}$.

However, the solutions to \eqref{eq1} are given by $(x_0,y_0) = (3,2)$, $x_{n+1} = 3x_n + 4y_n$, and $y_{n+1} = 2x_n + 3y_n$. A calculation modulo 5 and modulo 7 as in Table~\ref{Tab1A} yields $y \equiv \modd{0} {5} \iff y \equiv \modd{0} {7}$; hence, $y \neq 2\cdot 10^r$.


\begin{table}[hbt] 
\begin{center}
\begin{tabular}{c|cc|cc}
$n$ &amp; $x_n\bmod{5}$ &amp; $y_n\bmod{5}$ &amp; $x_n\bmod{7}$ &amp; $y_n\bmod{7}$\\ 
\hline
0 &amp; 3 &amp; 2 &amp; 3 &amp; 2\\
1 &amp; 2 &amp; 2 &amp; 3 &amp; 5\\
2 &amp; 4 &amp; 0 &amp; 1 &amp; 0\\
3 &amp; 2 &amp; 3 &amp; 3 &amp; 2\\
4 &amp; 3 &amp; 3 &amp; 3 &amp; 5\\
5 &amp; 1 &amp; 0 &amp; 1 &amp; 0\\
6 &amp; 3 &amp; 2 &amp; 3 &amp; 2\\
7 &amp; \multicolumn{4}{c}{$\dots$}
\end{tabular}
\caption{Solutions of equation \eqref{eq1} for $d=1$, Case A, mod $5$ and mod $7$.}
\label{Tab1A}
\end{center}
\end{table}

\item[Case B:] $i$ is odd, i.e., $i = 2r + 1$, $r\in\mathbb{N}$. Then we have $(3p)^2-20\cdot(2\cdot10^r)^2 = 1$, and we can seek solutions to 
\begin{align}
x^2 -20y^2 = 1 \label{eq2}
\end{align}
 with $x = 3p$, $y = 2  \cdot 10^r$, and $r \geq 1$. Hence, we have $y \equiv \modd{0} {5}$ and $y \not\equiv \modd{0} {11}$.

But the solutions to \eqref{eq2} are $(x_0,y_0) = (9,2)$, $x_{n+1} = 9x_n + 40y_n$, and $y_{n+1} = 2x_n + 9y_n$. A calculation modulo $5$ and $11$ similar to the one in Case~A yields $y \equiv \modd{0} {5} \iff y \equiv \modd{0} {11}$, so $y \neq 2 \cdot 10^r$ with $r \geq 1$.
\end{itemize}

\subsection{The case $d=5$}
Here we have to find all solutions $(p,i)$ in positive integers with $i&gt;2$ for the diophantine equation 
\[p^2=44\cdots41=40\cdot \frac{10^i-1}{9}+1.\]
Assume there is a solution $(p,i)$.

\begin{itemize}[align=left]
\item[Case A:] $i$ is even, i.e., $i = 2r$, $r\in\mathbb{N}$, $r\geq 2$. Then we have $(3p)^2-10\cdot(2\cdot10^r)^2 = -31$, and we can seek solutions to the equation 
\begin{align}
x^2 -10y^2 &amp;= -31 \label{eq3}
\end{align}
 with $x = 3p$, $y = 2  \cdot 10^r$, $r \geq 2$. Hence, $y$ has to satisfy the congruences $y \equiv \modd{0} {8}$ and $y \not\equiv \modd{0} {7}$.

To solve equation~\eqref{eq3}, we observe the identity $1=19^2-10\cdot 6^2=(19+6\sqrt{10}) \cdot (19-6\sqrt{10})$. Thus, if $(x_n,y_n)$ is a solution of equation~\eqref{eq3}, we have
\begin{align*}
-31 &amp;= x_n^2-10y_n^2\\
&amp;=(x_n+y_n\sqrt{10}) \cdot (x_n-y_n\sqrt{10})\\
&amp;=(x_n+y_n\sqrt{10}) \cdot (19+6\sqrt{10}) \cdot (x_n-y_n\sqrt{10}) \cdot (19-6\sqrt{10})\\
&amp;=(19x_n+60y_n + (6x_n+19y_n)\sqrt{10}) \cdot (19x_n+60y_n - (6x_n+19y_n)\sqrt{10})\\
&amp;=(19x_n+60y_n)^2-10(6x_n+19y_n)^2\\
&amp;=x_{n+1}^2-10y_{n+1}^2
\end{align*}
with $x_{n+1} := 19x_n + 60y_n$, and $y_{n+1} := 6x_n + 19y_n$.

By recursion, we can generate entire sequences of solutions starting from an initial solution. But considering this recursion as a linear equation system with $x_n$ and $y_n$ as unknowns, we can go backwards, too: if $(x_{n+1}, y_{n+1})$ is a solution of equation~\eqref{eq3}, then $(x_n, y_n)$ with $x_n=19x_{n+1}-60y_{n+1}$ and $y_n=19y_{n+1}-6x_{n+1}$ is also a solution. 

As long as $60 y_{n+1}&lt;19x_{n+1}$, and $6x_{n+1}&lt;19 y_{n+1}$, both $x_n$ and $y_n$ are positive. The second inequality follows for all positive solutions of equation~\eqref{eq3} via 
\begin{align*}
&amp; x_{n+1}^2-10y_{n+1}^2 = -31 &lt; 0\\
&amp;\Rightarrow 36 x_{n+1}^2 &lt; 360 y_{n+1}^2 &lt; 361 y_{n+1}^2\\
&amp;\Rightarrow 6x_{n+1}&lt;19 y_{n+1}.
\end{align*}
Provided that $y_{n+1}\geq 34$, the first inequality is also true. If it was not, we would have $361 x_{n+1} \leq 3600y_{n+1}$, and thus $x_{n+1}^2 \leq \left(10-\frac{10}{361}\right) y_{n+1}^2$ and 
\[-31=x_{n+1}^2-10y_{n+1}^2 \leq -\frac{10}{361} \cdot y_{n+1}^2 \leq -\frac{10}{361} \cdot 34^2=-\frac{11560}{361}&lt;-\frac{11191}{361}=-31.\]

Hence, every solution $(x_{n+1},y_{n+1})$ of equation~\eqref{eq3} in positive integers with $y_{n+1}\geq 34$ leads to another such solution $(x_n,y_n)$. And with $y_{n+1}\geq 34$. we have $x_{n+1}&gt;3y_{n+1}$, since otherwise we would get the contradiction $-31=x_{n+1}^2-10y_{n+1}^2\leq -y_{n+1}^2\leq -34^2&lt;-31$. Thus, $y_n=19y_{n+1}-6x_{n+1} &lt; 19y_{n+1}-18y_{n+1}=y_{n+1}$. 

Thus, provided that $(x_{n+1}, y_{n+1})$ is a solution of equation~\eqref{eq3} in positive integers with $y_{n+1}\geq 34$, we get a new solution $(x_n,y_n)$ of this equation in positive integers with a smaller second component. 

This can now be considered in the other direction, again: every solution of  equation~\eqref{eq3} in positive integers can be obtained via the recursion $x_{n+1} := 19x_n + 60y_n$ and $y_{n+1} := 6x_n + 19y_n$ from an initial solution $(x_n,y_n)$ with $0&lt;y_n&lt;34$. Checking all possibilities with $0&lt;x$ and $0&lt;y\leq 34$ yields the two solutions  $(x_0,y_0) \in\{(3,2), (63,20)\}$. From there, we get all other solutions of \eqref{eq3} via recursion. 

As in the case $d=1$, a calculation modulo $8$ and $7$ now yields $y \equiv \modd{0} {8} \iff y \equiv \modd{0} {7}$, so $y \neq 2 \cdot 10^r$.

\item[Case B:] $i$ is odd, i.e., the number of occurrences
of the digit $4$ in the decimal representation of $p^2$ is odd. In this case, according to a basic rule
\[44\cdots41\equiv 1 - 4 + (4 - 4) + \dots + (4 - 4) \equiv -3 \equiv \modd{8} {11},\] 
which is not a quadratic residue modulo~$11$.

(This is Problem 2 from the first round of the 2024 Bundeswettbewerb Mathematik in Germany \cite{BWM}. When we tried to solve the related open question for Case~A, i.e., whether 1 and 441 are the only squares with an even number of 
occurrences of the digit $4$, we came across Ballew's and Weger's flawed proof and ended up with this paper.)
\end{itemize}

\subsection{The case $d=6$}
Assume there is a solution $(p,i)$ with $i\geq 4$. (The cases with $i\leq 3$ yield the solutions $T_3$, $T_{11}$, and $T_{36}$.) Then we have
\[p^2=53\cdots329=48\cdot \frac{10^i-1}{9}+1 \iff 9p^2-3 \cdot (4^2 \cdot 10^i)=-39.\]

\begin{itemize}[align=left]
\item[Case A:] $i$ is even, i.e., $i=2r$ with $r\geq 2$. Thus, $3p^2-(4\cdot 10^r)^2=-13$ and we can seek solutions to the Pell equation 
\begin{align}
x^2-3y^2&amp;=13 \label{eq4}
\end{align}
 with the additional requirement of $x=4\cdot 10^r$, $y=3p$, and $r\geq 2$. Hence, it has to be $x\equiv \modd{0} {50}$. We can obtain all solutions of \eqref{eq4}, starting from $(x_0,y_0)=(4,1)$ or $(x_0,y_0)=(5,2)$, through the recursion $x_{n+1}=2x_n+3y_n$, and $y_{n+1}=x_n+2y_n$ by the same method used in the case $d=5$. A calculation modulo $50$ and $241$ as in the case $d=1$ yields $x_i \equiv \modd{0} {50} \iff x_i \equiv \modd{94} {241}$. Thus, in every solution, we have $94 \equiv \modd{4 \cdot 10^r} {241}$ and, therefore, $10^r \equiv \modd{144} {241}$. However, this is not the case for any positive integer $r$.

\item[Case B:] $i$ is odd, i.e., $i = 2r + 1$ with $r\geq 2$. This leads to $(3p)^2 - 30 \cdot (4 \cdot 10^r)^2 = -39$ and therefore, the Pell equation 
\begin{align}
x^2-30y^2&amp;=-39  \label{eq5}
\end{align}
 with $x=3p$, $y=4 \cdot 10^r$, and $r\geq 2$. All solutions of \eqref{eq5} can be obtained from the starting solutions $(x_0,y_0)=(9,2)$ or $(x_0,y_0)=(21,4)$ through the recursion $x_{n+1}=11x_n+60y_n$, $y_{n+1}=2x_n+11y_n$ using the same methods as above. 

Now assume that there is a solution with $r\geq 4$. It follows that $y=4\cdot 10^r \equiv \modd{0} {64}$. A calculation modulo $64$ and $31$, as in the case $d=1$, reveals that $y_i\equiv \modd{0} {64}$ is equivalent to $y_i\equiv \modd{3} {31}$, and, therefore, $10^r \equiv \modd{24} {31}$, which is not the case for any positive integer $r$.

In the cases with $r\in\{2,3\}$, it can be verified that in both families of solutions of \eqref{eq5} we have $y_3&gt;4000$. Consequently, the only remaining candidates for additional solutions are $(x_1,y_1)$ and $(x_2,y_2)$ in both families. However, a brief calculation reveals that they are not solutions to the original problem.
\end{itemize}

This demonstrates that, in each case, there are no additional solutions beyond those initially presented in the paper, thereby establishing the proof of Theorem~\ref{Thm:main}.

\begin{remark}
The method can be applied in the generalized version with repeated blocks of 
digits as well. In consideration of blocks of length $2$, as presented in \cite{Kafle}, we have to solve the equation
\begin{alignat}{3}
&amp;&amp;\frac{k(k+1)}{2} &amp;= c\cdot \frac{100^i-1}{99}, \text{ $c\in\{10,\dots,99\}$} \notag\\
&amp;\iff&amp;(2k+1)^2 &amp;= 8c\cdot \frac{100^i-1}{99}+1 \notag\\
&amp;\iff&amp;(33\cdot (2k+1))^2 &amp;= 88c \cdot 100^i + 1089 - 88c \notag\\
&amp;\iff&amp;x^2-22c \cdot y^2 &amp;= 1089-88c, \label{eq6}
\end{alignat}
with $x:=33\cdot (2k+1)$, $y:=2\cdot 10^i$ in positive integers. Now we can compute the set of all integer solutions $(x,y)$ to the Pell equation~\eqref{eq6} and find moduli that disprove that $y$ can be of the form $y=2\cdot 10^i$.
\end{remark}

\begin{thebibliography}{9}
\bibitem{Ballew} D. W. Ballew and R. C. Weger, 
\href{https://yutaka-nishiyama.sakura.ne.jp/math/repdigit.pdf}{Repdigit triangular numbers}, \textit{J. Recreat. Math.} \textbf{8} (1975--1976), 96--98.

\bibitem{Escott} E. B. Escott and C. E. Youngman, \href{https://archive.org/details/educationaltimes58educ/page/87/mode/1up}{Problem~15648}, \textit{Educational Times} \textbf{8} (1905), 33--34.

\bibitem{BWM} K. Fegert, Bundeswettbewerb Mathematik---Aufgaben und L\"osungen 1. Runde 2024, 2024. Available at \url{https://www.mathe-wettbewerbe.de/fileadmin/Mathe-Wettbewerbe/Bundeswettbewerb_Mathematik/Dokumente/Aufgaben_und_Loesungen_BWM/2024/loes_24_1_e.pdf} .

\bibitem{Gauss} C. F. Gau\ss, \textit{Disquisitiones Arithmeticae}, 
Fleischer, 1801.

\bibitem{Kafle}B. Kafle, F. Luca, and A. Togb\'e, Triangular repblocks, \textit{Fibonacci 
Quart.} \textbf{56} (2018), 325--328.

\bibitem{MO} Mathoverflow discussion, Triangular repdigits, 2024.  Available at
\url{https://mathoverflow.net/questions/467405/triangular-repdigits}.
\end{thebibliography}


\bigskip
\hrule
\bigskip

\noindent 2020 {\it Mathematics Subject Classification}:
Primary 11D09; Secondary 11D61.

\noindent \emph{Keywords: } triangular number, repeated digit, Pell's equation. 

\bigskip
\hrule
\bigskip

\noindent (Concerned with sequence
\seqnum{A045914}.)

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received July 31 2024;
revised versions received August 1 2024; March 6 2025.
Published in {\it Journal of Integer Sequences}, March 6 2025.

\bigskip
\hrule
\bigskip

\noindent
Return to
\href{https://cs.uwaterloo.ca/journals/JIS/}{Journal of Integer Sequences home page}.
\vskip .1in


\end{document}
</pre></body></html>