Triangular Numbers With a Single Repeated Digit

Christian Hercher Institut für Mathematik Europa-Universität Flensburg Auf dem Campus 1c 24943 Flensburg Germany

           christian.hercher@uni-flensburg.de

Karl Fegert Neu-Ulm Germany

                 karl.fegert@arcor.de

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.

1 Introduction

The study of triangular numbers—integers of the form \frac{k(k+1)}{2}—is a long-standing and wellresearched area within the field of number theory. For example, Gauß proved in his Disquisitiones Arithmeticae [4] 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 · \frac{10^{i}−1}{9} with some digit d ∈ \{1, …, 9\} and positive integer i? One instance of this question being posed is Problem 15648 in the Educational Times [2], 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 [1] presented an erroneous proof for the following theorem.

Theorem 1. The only triangular numbers whose decimal representations consist of a single repeated digit are 1, 3, 6, 55, 66, and 666.

In a recent contribution, Kafle, Luca, and Togbé [5] 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 [6], a discussion regarding this topic was held. In this discussion, the error in Ballew and Weger’s proof of Theorem 1 was identified, and a proof using the methods of elliptic curves was presented. In this paper, we provide an elementary proof of Theorem 1 using only Pell equations.

1.1 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 3, a proof is provided for each remaining digit, demonstrating that there are no further triangular numbers consisting of a single repeated digit.

2 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

T_{k} = \frac{k(k + 1)}{2} = d · \frac{10^{i} − 1}{9}, i ≥ 1, d ∈ \{1, …, 9\}
⟺
(2k + 1)^{2} = 4k^{2} + 4k + 1 = 8d · \frac{10^{i} − 1}{9} + 1.

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

From the previous line, we see that D satisfies the congruence D ≡ 1+8d (mod 10). Thus, immediately, we can rule out d ∈ {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:

d = 1: If i = 1, it follows that D = 8 · \frac{10^{i}−1}{9} + 1 = 9 = 3^{2}, which yields T_{1} = 1, and for i > 1, we have D = 88 ⋯ 89.

d = 3: If i = 1, then D = 24 · \frac{10^{i}−1}{9} + 1 = 25 = 5^{2}, which yields T_{2} = 3. Otherwise, we have D = 26 ⋯ 65.

d = 5: If i = 1, we have D = 40 · \frac{10^{i}−1}{9} + 1 = 41. For i = 2, we get D = 441 = 21^{2}, which yields T_{10} = 55, and for i > 2, it follows that D = 44 ⋯ 41.

d = 6: If i = 1, 2, or 3, then D = 48· \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 > 3, we have D = 53 ⋯ 329.

d = 8: If i = 1 or 2, then D = 64 · \frac{10^{i}−1}{9} + 1 = 65 or D = 705. Otherwise, D = 71 ⋯ 105.

Since ⋯ 05 and ⋯ 65 cannot be the last two digits of a square number, we can exclude d = 8 and d = 3, except for T_{2}.

2.1 The false statement

Ballew and Weger incorrectly asserted that there is no integer z whose square ends in ⋯ 88889. This assertion is, however, erroneous. For example, 8072917^{2} = ⋯ 88888889. In fact, since z^{2} ≡ ⋯ 88889 ≡ 1 + 8 · \frac{10^{k+1}−1}{10−1} ≡ 1 − \frac{1}{9} (mod 10^{k}) is equivalent to 9z^{2} − 1 ≡ (3z − 1)(3z + 1) ≡ 0 (mod 10^{k}), there are solutions for every k; for example, z = ⋯ 3333. Consequently, there are square numbers whose last digits are ⋯ 8889 with an arbitrary number of 8’s.

3 A proof using Pell’s equations

This section introduces a new line of reasoning, which rules out the remaining cases, namely those with d ∈ {1, 5, 6}.

3.1 The case d = 1

In this case, we have to find all positive integers p, i with

p^{2} = 88 ⋯ 89 = 8 · \frac{10^{i} − 1}{9} + 1 ⟺ (3p)^{2} − (8 · 10^{i}) = 1.

Assuming there is a solution for i ≥ 2 (the case i = 1 leads to T_{1}). Then we can make a case distinction by using the parity of i.

Case A: i is even, i.e., i = 2r, r ∈ ℕ. Subsequently, we have

(3p)^{2} − 2 · (2 · 10^{r})^{2} = 1,

and we can seek solutions to the Pell equation

x^{2} − 2y^{2} = 1  (1)

with the requirements x = 3p, y = 2·10^{r}, and r ≥ 1. Thus, y must satisfy y ≡ 0 (mod 5) and y ≢ 0 (mod 7).

However, the solutions to (1) 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 1 yields y ≡ 0 (mod 5) ⟺ y ≡ 0 (mod 7); hence, y ≠ 2 · 10^{r}.

n x_{n} mod 5 y_{n} mod 5 x_{n} mod 7 y_{n} mod 7
0  3  2  3  2
1  2  2  3  5
2  4  0  1  0
3  2  3  3  2
4  3  3  3  5
5  1  0  1  0
6  3  2  3  2
7  …

Table 1: Solutions of equation (1) for d = 1, Case A, mod 5 and mod 7.

Case B: i is odd, i.e., i = 2r + 1, r ∈ ℕ. Then we have (3p)^{2} − 20 · (2 · 10^{r})^{2} = 1, and we can seek solutions to

x^{2} − 20y^{2} = 1  (2)

with x = 3p, y = 2·10^{r}, and r ≥ 1. Hence, we have y ≡ 0 (mod 5) and y ≢ 0 (mod 11).

But the solutions to (2) 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 ≡ 0 (mod 5) ⟺ y ≡ 0 (mod 11), so y ≠ 2 · 10^{r} with r ≥ 1.

3.2 The case d = 5

Here we have to find all solutions (p, i) in positive integers with i > 2 for the diophantine equation

p^{2} = 44 ⋯ 41 = 40 · \frac{10^{i} − 1}{9} + 1.

Assume there is a solution (p, i).

Case A: i is even, i.e., i = 2r, r ∈ ℕ, r ≥ 2. Then we have (3p)^{2} − 10 · (2 · 10^{r})^{2} = −31, and we can seek solutions to the equation

x^{2} − 10y^{2} = −31  (3)

with x = 3p, y = 2 · 10^{r}, r ≥ 2. Hence, y has to satisfy the congruences y ≡ 0 (mod 8) and y ≢ 0 (mod 7).

To solve equation (3), we observe the identity 1 = 19^{2}−10·6^{2} = (19+6\sqrt{10})·(19−6\sqrt{10}). Thus, if (x_{n}, y_{n}) is a solution of equation (3), we have

−31 = x_{n}^{2} − 10y_{n}^{2}
= (x_{n} + y_{n}\sqrt{10}) · (x_{n} − y_{n}\sqrt{10})
= (x_{n} + y_{n}\sqrt{10}) · (19 + 6\sqrt{10}) · (x_{n} − y_{n}\sqrt{10}) · (19 − 6\sqrt{10})
= (19x_{n} + 60y_{n} + (6x_{n} + 19y_{n})\sqrt{10}) · (19x_{n} + 60y_{n} − (6x_{n} + 19y_{n})\sqrt{10})
= (19x_{n} + 60y_{n})^{2} − 10(6x_{n} + 19y_{n})^{2}
= x_{n+1}^{2} − 10y_{n+1}^{2}

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 (3), 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 60y_{n+1} < 19x_{n+1}, and 6x_{n+1} < 19y_{n+1}, both x_{n} and y_{n} are positive. The second inequality follows for all positive solutions of equation (3) via

x_{n+1}^{2} − 10y_{n+1}^{2} = −31 < 0
⇒ 36x_{n+1}^{2} < 360y_{n+1}^{2} < 361y_{n+1}^{2}
⇒ 6x_{n+1} < 19y_{n+1}.

Provided that y_{n+1} ≥ 34, the first inequality is also true. If it was not, we would have 361x_{n+1} ≤ 3600y_{n+1}, and thus x_{n+1}^{2} ≤ (10 − \frac{10}{361}) y_{n+1}^{2} and

−31 = x_{n+1}^{2} − 10y_{n+1}^{2} ≤ −\frac{10}{361} · y_{n+1}^{2} ≤ −\frac{10}{361} · 34^{2} = −\frac{11560}{361} < −\frac{11191}{361} = −31.

Hence, every solution (x_{n+1}, y_{n+1}) of equation (3) in positive integers with y_{n+1} ≥ 34 leads to another such solution (x_{n}, y_{n}). And with y_{n+1} ≥ 34. we have x_{n+1} > 3y_{n+1}, since otherwise we would get the contradiction −31 = x_{n+1}^{2} − 10y_{n+1}^{2} ≤ −y_{n+1}^{2} ≤ −34^{2} < −31. Thus, y_{n} = 19y_{n+1} − 6x_{n+1} < 19y_{n+1} − 18y_{n+1} = y_{n+1}.

Thus, provided that (x_{n+1}, y_{n+1}) is a solution of equation (3) in positive integers with y_{n+1} ≥ 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 (3) 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 < y_{n} < 34. Checking all possibilities with 0 < x and 0 < y ≤ 34 yields the two solutions (x_{0}, y_{0}) ∈ {(3, 2), (63, 20)}. From there, we get all other solutions of (3) via recursion.

As in the case d = 1, a calculation modulo 8 and 7 now yields y ≡ 0 (mod 8) ⟺ y ≡ 0 (mod 7), so y ≠ 2 · 10^{r}.

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 ⋯ 41 ≡ 1 − 4 + (4 − 4) + ⋯ + (4 − 4) ≡ −3 ≡ 8 (mod 11),

which is not a quadratic residue modulo 11.

(This is Problem 2 from the first round of the 2024 Bundeswettbewerb Mathematik in Germany [3]. 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.)

3.3 The case d = 6

Assume there is a solution (p, i) with i ≥ 4. (The cases with i ≤ 3 yield the solutions T_{3}, T_{11}, and T_{36}.) Then we have

p^{2} = 53 ⋯ 329 = 48 · \frac{10^{i} − 1}{9} + 1 ⟺ 9p^{2} − 3 · (4^{2} · 10^{i}) = −39.

Case A: i is even, i.e., i = 2r with r ≥ 2. Thus, 3p^{2} − (4 · 10^{r})^{2} = −13 and we can seek solutions to the Pell equation

x^{2} − 3y^{2} = 13  (4)

with the additional requirement of x = 4 · 10^{r}, y = 3p, and r ≥ 2. Hence, it has to be x ≡ 0 (mod 50). We can obtain all solutions of (4), 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} ≡ 0 (mod 50) ⟺ x_{i} ≡ 94 (mod 241). Thus, in every solution, we have 94 ≡ 4 · 10^{r} (mod 241) and, therefore, 10^{r} ≡ 144 (mod 241). However, this is not the case for any positive integer r.

Case B: i is odd, i.e., i = 2r + 1 with r ≥ 2. This leads to (3p)^{2} − 30 · (4 · 10^{r})^{2} = −39 and therefore, the Pell equation

x^{2} − 30y^{2} = −39  (5)

with x = 3p, y = 4·10^{r}, and r ≥ 2. All solutions of (5) 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 ≥ 4. It follows that y = 4·10^{r} ≡ 0 (mod 64). A calculation modulo 64 and 31, as in the case d = 1, reveals that y_{i} ≡ 0 (mod 64) is equivalent to y_{i} ≡ 3 (mod 31), and, therefore, 10^{r} ≡ 24 (mod 31), which is not the case for any positive integer r.

In the cases with r ∈ {2, 3}, it can be verified that in both families of solutions of (5) we have y_{3} > 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.

This demonstrates that, in each case, there are no additional solutions beyond those initially presented in the paper, thereby establishing the proof of Theorem 1.

Remark 2. 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 [5], we have to solve the equation

\frac{k(k + 1)}{2} = c · \frac{100^{i} − 1}{99}, c ∈ \{10, …, 99\}
⟺  (2k + 1)^{2} = 8c · \frac{100^{i} − 1}{99} + 1
⟺ (33 · (2k + 1))^{2} = 88c · 100^{i} + 1089 − 88c
⟺ x^{2} − 22c · y^{2} = 1089 − 88c,  (6)

with x := 33 · (2k + 1), y := 2 · 10^{i} in positive integers. Now we can compute the set of all integer solutions (x, y) to the Pell equation (6) and find moduli that disprove that y can be of the form y = 2 · 10^{i}.

References

[1] D. W. Ballew and R. C. Weger, Repdigit triangular numbers, J. Recreat. Math. 8 (1975– 1976), 96–98.

[2] E. B. Escott and C. E. Youngman, Problem 15648, Educational Times 8 (1905), 33–34.

[3] K. Fegert, Bundeswettbewerb Mathematik—Aufgaben und Lösungen 1. Runde

   2024, 2024. Available at https://www.mathe-wettbewerbe.de/fileadmin/

   Mathe-Wettbewerbe/Bundeswettbewerb_Mathematik/Dokumente/Aufgaben_und_

   Loesungen_BWM/2024/loes_24_1_e.pdf .

[4] C. F. Gauß, Disquisitiones Arithmeticae, Fleischer, 1801.

[5] B. Kafle, F. Luca, and A. Togbé, Triangular repblocks, Fibonacci Quart. 56 (2018), 325–328.

[6] Mathoverflow discussion, Triangular repdigits, 2024. Available at https://

   mathoverflow.net/questions/467405/triangular-repdigits.

2020 Mathematics Subject Classification: Primary 11D09; Secondary 11D61. Keywords: triangular number, repeated digit, Pell’s equation.

(Concerned with sequence \underline{A045914}.)

Received July 31 2024; revised versions received August 1 2024; March 6 2025. Published in Journal of Integer Sequences, March 6 2025.

Return to Journal of Integer Sequences home page.