On Obláth’s problem

Alexandru Gica and Laurenţiu Panaitopol Department of Mathematics University of Bucharest Str. Academiei 14 RO–70109 Bucharest 1 Romania alex@al.math.unibuc.ro pan@al.math.unibuc.ro

Abstract. In this paper we determine those squares whose decimal representation consists of k ≥ 2 digits such that k − 1 of them equal.

1 Introduction

R. Obláth [5] succeeded in almost entirely solving the problem of finding all the numbers n^{m} (n, m ∈ ℕ, n ≥ 2, m ≥ 2) that have equal digits. The special case m = 2 is a very well known result, although its proof involves no difficulty. In this connection, the following question naturally arises: is it possible to determine all of the squares having all digits but one equal?

The answer is given by

Theorem 1.1 The squares whose decimal representation makes use of k ≥ 2 digits, such that k − 1 of these digits are equal, are precisely 16, 25, 36, 49, 64, 81, 121, 144, 225, 441, 484, 676, 1444, 44944, 10^{2i}, 4 · 10^{2i} and 9 · 10^{2i} with i ≥ 1.

When we are looking for the squares with k digits among which k − 1 digits equal 0, we immediately get that the corresponding numbers are 10^{2i}, 4 · 10^{2i} and 9 · 10^{2i} with i ≥ 1.

A simple computation shows that the numbers with at most 4 digits verifying the condition in the statement are just the ones listed above.

Since every natural number can be written in the form 50000k ± r with 0 ≤ r ≤ 25000, and (50000k ± r)^{2} ≡ r^{2} (mod 100000), we compute r^{2} for r ≤ 25000 and find that the last 4 digits of any square can be equal only when all of them equal 0, which solves Obláth’s problem for squares having k ≥ 4 digits.

We select the squares such that 4 of the last 5 digits are equal, because these point out the possible squares with k ≥ 5 digits, k − 1 digits of them being equal. If one excludes the numbers for which there are k − 1 digits equal to 0, then there still remain 22 types of numbers, namely:

a_{1} = 1 ⋯ 121 a_{7} = 4 ⋯ 441 a_{13} = 4 ⋯ 4944 a_{18} = 7 ⋯ 76
a_{2} = 1 ⋯ 161 a_{8} = 4 ⋯ 449 a_{14} = 4 ⋯ 45444 a_{19} = 8 ⋯ 81
a_{3} = 2 ⋯ 224 a_{9} = 4 ⋯ 464 a_{15} = 4 ⋯ 49444 a_{20} = 8 ⋯ 89
a_{4} = 2 ⋯ 225 a_{10} = 4 ⋯ 484 a_{16} = 5 ⋯ 56  a_{21} = 9 ⋯ 929
a_{5} = 4 ⋯ 41444 a_{11} = 4 ⋯ 4544 a_{17} = 6 ⋯ 656 a_{22} = 9 ⋯ 969
a_{6} = 4 ⋯ 4144 a_{12} = 4 ⋯ 4644

One will show that, among these numbers with k ≥ 5 digits, only 44944 is a square. The exclusion of the other numbers can be carried out fairly easily in certain cases, as we show in §2. In the other cases we will solve equations of the type

x^{2} − dy^{2} = k  (1)

(where d, k ∈ ℤ^{∗}, d > 0 and \sqrt{d} ∉ ℤ) in integers. The literature concerning equation (1) is rather extensive. In this connection, we mention [1, 2, 3, 4].

We now recall the solving method (in accordance with [2]). We denote by (r, s) the minimal positive solution to the equation

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

and by ε = r + s\sqrt{d}. We determine the “small” solutions to equation (1) (if any). They generate all the solutions.

Theorem 1.2 We denote by μ_{i} = a_{i} + b_{i}\sqrt{d}, i = \overline{1, m} all the numbers with the property that (a_{i}, b_{i}) is a solution in nonnegative integers to equation (1) with a_{i} ≤ \sqrt{|k|ε} and b_{i} ≤ \sqrt{ε|k|/d} (if any). If x and y are solutions to (1) then there exist i, n ∈ ℤ such that 1 ≤ i ≤ m and x + y\sqrt{d} = ±μ_{i}ε^{n} or x + y\sqrt{d} = ±μ̄_{i}ε^{n}.

We will use this theorem in §3.

2 Excluding the simple cases

We assume in this section that k ≥ 5 and a_{n} is a square, hence 9a_{n} is a square as well. Make use of simple reasonings, we shall show that this fact is impossible. To this end, we use the symbol of Legendre in some cases.

The 16 cases which have to be excluded will be exposed in a concise form, inasmuch as some of them are quite similar:

a_{3}, a_{4}, a_{20}; a_{2}, a_{15}, a_{18}; a_{11}, a_{17}.

We mention that each of the cases below is concluded by a contradictory assertion, thus proving the impossibility of the corresponding case.

1. We have 9a_{2} = 10^{k} + 449 ≡ (−1)^{k} + 9 (mod 11). But (\frac{8}{11}) = (\frac{10}{11}) = −1.

2. It follows by 9a_{3} = 2(10^{k} + 8) = (4x)^{2} that 2^{k−3}5^{k} = (x − 1)(x + 1). Since (x − 1, x + 1) = 2, we have 5^{k} | x + ε with ε ∈ {−1, 1}, whence x + 1 ≥ 5^{k}. Consequently 2^{k−3} · 5^{k} = x^{2} − 1 ≥ 5^{k}(5^{k} − 2), hence 2^{k−3} ≥ 5^{k} − 2.

3. By 9a_{4} = 2 · 10^{k} + 25 = (5x)^{2}, we have 2^{k+1} · 5^{k−2} = (x − 1)(x + 1), whence 2^{k+1} · 5^{k−2} ≥ 5^{k−2}(5^{k−2} − 2).

4. We have 9a_{5} = 4 · 10^{k} − 27004 = (2x)^{2}, whence 10^{k} − 6751 = x^{2}. When k is an odd number, we have 10^{k} − 6751 ≡ 2 (mod 11), but (\frac{2}{11}) = −1. If k = 2h with h ≥ 3, then (10^{h} − x)(10^{h} + x) = 6751, whence 10^{h} − x = a, 10^{h} + x = b, where we have either (a, b) = (1, 6751) or (a, b) = (43, 157). Since 2·10^{h} = a+b, it follows that either 2·10^{h} = 6752 or 2 · 10^{h} = 200, although h ≥ 3.

5. By 9a_{6} = 4 · 10^{k} − 2704 = (4x)^{2} it follows that 5^{2} · 10^{k−2} − 169 = x^{2}. Since k ≥ 5, we

get that x^{2} = 5^{2} · 10^{k−2} − 169 ≡^{4} −169 ≡^{4} 3.

6. We have a_{9} = 4 · 11 ⋯ 16, but 11 ⋯ 16 does not occur among the numbers a_{i}.

7. We have a_{10} = 4a_{1}, and we shall get the contradiction after we study a_{1} for k ≥ 5.

8. We have 9a_{11} = 4 · 10^{k} + 896 = (8x)^{2}, hence 2^{k−4}5^{k} + 14 = x^{2}. It follows that x⋮2. Therefore x^{2}⋮4, and k = 5. In this case we get x^{2} = 6264.

9. We have a_{12} = 4a_{2}, but a_{2} ≠ x^{2}.

10. By 9a_{15} = 4·10^{k}+44996 = (2x)^{2} it follows that 10^{k}+11249 = x^{2}. Then 10^{k}+11249 ≡ (−1)^{k} + 7 (mod 11), but (\frac{6}{11}) = (\frac{8}{11}) = −1.

11. Since 4a_{16} = \underbrace{22 ⋯ 2}_{k} 4 and a_{3} ≠ x^{2}, it follows that a_{16} ≠ y^{2}.

12. We have 9a_{17} = 6 · 10^{k} − 96 = (4x)^{2}, hence 3 · 2^{k−3}5^{k} − 6 = x^{2}. But x^{2}⋮4 and 3 · 2^{k−3}5^{k}⋮4 (because k ≥ 5).

13. We have 9a_{18} = 7 · 10^{k} − 16 ≡ 7(−1)^{k} − 5 (mod 11). But (\frac{2}{11}) = (\frac{10}{11}) = −1.

14. By 9a_{20} = 8 · 10^{k} + 1 = x^{2} it follows that (x − 1)(x + 1) = 2^{k+3}5^{k} and then 2^{k+3}5^{k} ≥ 5^{k}(5^{k} − 2).

15. We have a_{21} ≡ 2 (mod 9).

16. We have a_{22} ≡ 6 (mod 9).

3 The six difficult cases

Just as in the previous cases, the numbers under consideration have k ≥ 5 digits, and k − 1 of these digits are equal.

1. For a_{1} = 11 ⋯ 121 = x^{2} it follows that (10^{k} − 1)/9 + 10 = x^{2}. We denote y = 3x and, since k ≥ 5, we have y > 316 and

10^{k} − y^{2} = −89.  (3)

For k = 2m we have (10^{m} − y)(10^{m} + y) = −89, whence we get both 10^{m} − y = −1 and 10^{m} + y = 89, which is a contradiction.

For k = 2m + 1, we denote z = 10^{m} and then

y^{2} − 10z^{2} = 89.

The primitive solution of the Pell equation

x^{2} − 10y^{2} = 1

is (r, s) = (19, 6). Making use of Theorem 1.2 in the Introduction, we get b_{i} ≤ \sqrt{\frac{89}{10} (19 + 6\sqrt{10})}, hence b_{i} ≤ 18. We find b_{1} = 8, a_{1} = 27, and b_{2} = 10, a_{2} = 33.

It follows that either

y + z\sqrt{10} = (±27 ± 8\sqrt{10}) (19 + 6\sqrt{10})^{t}

or

y + z\sqrt{10} = (±33 ± 10\sqrt{10}) (19 + 6\sqrt{10})^{t} ,

with t ∈ ℤ. Since y > 0, z > 0, we have only the solutions

y + z\sqrt{10} = (27 ± 8\sqrt{10}) (19 + 6\sqrt{10})^{t}

and

y + z\sqrt{10} = (33 ± 10\sqrt{10}) (19 + 6\sqrt{10})^{t} ,

with t ∈ ℤ. Since \frac{27+8\sqrt{10}}{19+6\sqrt{10}} < 2 and \frac{33+10\sqrt{10}}{19+6\sqrt{10}} < 2, it follows that t ∈ ℕ. Let (19 + 6\sqrt{10})^{t} = a_{t} + b_{t}\sqrt{10}, a_{t}, b_{t} ∈ ℕ, a_{0} = 1, b_{0} = 0. For t ≥ 1, we have the following equalities:

a_{t} = 19^{t} + C_{t}^{2}19^{t−2} · 6^{2} · 10 + ⋯  (4)

and

b_{t} = C_{t}^{1}19^{t−1} · 6 + C_{t}^{3}19^{t−3} · 6^{3} · 10 + · · · .  (5)

We have a_{t} ≡ 1 (mod 3) and b_{t} ≡ 0 (mod 3). Since z = 10^{m} ≡ 1 (mod 3), we only have one of the situations

y + z\sqrt{10} = (27 − 8\sqrt{10}) (19 + 6\sqrt{10}) , t ∈ ℕ,  (6)

and

y + z\sqrt{10} = (33 + 10\sqrt{10}) (19 + 6\sqrt{10}) , t ∈ ℕ.  (7)

a) In the case of the relation (6), we have the identity

z = 10^{m} = 27b_{t} − 8a_{t}.  (8)

Since k ≥ 5, it follows that m ≥ 2.

For m = 2, the equation (3) takes the form y^{2} − 10^{5} = 89, and has no integer solutions. For m ≥ 3, it follows that 8 | b_{t}. By (5) we have b_{t} ≡ 6t · 19^{t−1} (mod 8), whence t = 4h.

It then follows by (4) and (5) that

a_{t} ≡ 6^{4h} · 10^{2h} (mod 19) and 19 | b_{t}.

By (8) we get 10^{m} ≡ −8 · 6^{4h} · 10^{2h} (mod 19), whence

(\frac{10^{m}}{19} ) = (\frac{−8 · 6^{4t} · 10^{2h}}{19} ) = (\frac{−2}{19}) = 1.

Since (\frac{10}{19}) = (\frac{−9}{19}) = (−1) · (\frac{3^{2}}{19}) = −1, it follows that m = 2f.

The equation (3) takes the form

10^{4f+1} + 89 = y^{2}.  (9)

We have 10^{4} ≡ 1 (mod 101), hence 10^{4f+1} ≡ 10 (mod 101). In view of (9), it follows that

y^{2} ≡ 99 (mod 101).

But (\frac{99}{101}) = (\frac{−2}{101}) = (\frac{2}{101}) = −1, and thus a contradiction.

b) It follows by (7) that

z = 10^{m} = 33b_{t} + 10a_{t}.  (10)

Since m ≥ 3, it follows that b_{t} + 2a_{t} ≡ 0 (mod 8). By (4) and (5) we have a_{t} ≡ 19^{t} (mod 8) and b_{t} ≡ 6t · 19^{t−1} (mod 8). Therefore 6t · 19^{t−1} + 2 · 19^{t} ≡ 0 (mod 8), which in turn implies 3t+19 ≡ 0 (mod 4) and t = 4h+3. Now (4), (5) and (10) imply that 10^{m} ≡ 33·6^{4h+3}·10^{2h+1} (mod 19), whence

(\frac{10^{m}}{19} ) = (\frac{33 · 6 · 10}{19} ) = (\frac{3^{2} · 2^{2} · 55}{19})

= (\frac{55}{19}) = (\frac{−2}{19}) = − (\frac{2}{19}) = −(−1)^{(19^{2}−1)/8}

= 1.

Consequently m = 2f, and we get (9) again, which is a contradiction.

2. For a_{7} = 44 ⋯ 41 = x^{2} it follows that 4 · \frac{10^{k}−1}{9} − 3 = x^{2}, hence

4 · 10^{k} − y^{2} = 31,  (11)

where y = 3x.

If k = 2m, then (2 · 10^{m} − y)(2 · 10^{m} + y) = 31. Hence

2 · 10^{m} − y = 1 and 2 · 10^{m} + y = 31,

which is a contradiction. If k = 2m + 1 then, denoting z = 2 · 10^{m}, we get the equation

y^{2} − 10z^{2} = −31.

Just as in the previous case, we make use of Theorem 1.2 and, for y > 0, z > 0, we get that either

y + z\sqrt{10} = (3 + 2\sqrt{10}) (19 + 6\sqrt{10})^{t}  (12)

or

y + z\sqrt{10} = (−3 + 2\sqrt{10}) (19 + 6\sqrt{10})^{t} ,  (13)

with t ∈ ℕ.

a) By (12) we obtain the equation:

2 · 10^{m} = 3b_{t} + 2a_{t}.  (14)

Since m ≥ 2, it follows by (5), (6) and (14) that 3 · 6t · 19^{t−1} + 2 · 19^{t} ≡ 0 (mod 8), that is, 9t + 19 ≡ 0 (mod 4), whence t = 4h + 1. By (4) and (5) we get that z ≡ 3 · 6^{4h+1} · 10^{2h} (mod 19), that is, 10^{m} ≡ 3^{2} · 6^{4h} · 10^{2h} (mod 19), whence (\frac{10^{m}}{19} ) = 1. Consequently m is an even number.

On the other hand, it follows by (14) that 3b_{t} + 2a_{t} ≡ 0 (mod 5), that is, a_{t} ≡ b_{t} (mod 5). By (4) and (5) it follows that a_{t} ≡ (−1)^{t} (mod 5) and b_{t} ≡ (−1)^{t−1}t (mod 5), whence t ≡ 4 (mod 5). We have (3 + \sqrt{10})^{5} = 4443 + 1405\sqrt{10} ≡ −53 (mod 281), hence (19 + 6\sqrt{10})^{5} = ((3 + \sqrt{10})^{5})^{2} ≡ 53^{2} ≡ −1 (mod 281). Consequently

y + 2 · 10^{m}\sqrt{10} = (3 + 2\sqrt{10}) (19 + 6\sqrt{10})^{t+1} (19 − 6\sqrt{10})
= (−63 + 20\sqrt{10}) [(19 + 6\sqrt{10})^{5} ]^{(t+1)/5}
≡ −63 + 20\sqrt{10} (mod 281).

We have taken into account that t ≡ 4 (mod 5) and t is an odd number.

We have 2 · 10^{m} ≡ 20 (mod 281), that is, 10^{m−1} ≡ 1 (mod 281). Since 10^{7} ≡ 53 (mod 281), it follows that 10^{14} ≡ −1 (mod 281) and 10^{28} ≡ 1 (mod 281). Thus we have ord \overline{10} = 28 in ℤ_{281}, whence 28 | m − 1, which is a contradiction since m is even.

b) It follows by (13) that

2 · 10^{m} = −3b_{t} + 2a_{t}.  (15)

Since m ≥ 2, it follows that −3b_{t} + 2a_{t} ≡ 0 (mod 8). We get by (4) and (5) that t = 4h + 3 and then 2 · 10^{m} ≡ −3 · 6^{4h+3} · 10^{2h+1} (mod 19). Therefore (\frac{10^{m}}{19} ) = 1, and m is even. Also by (15) we get a_{t} + b_{t} ≡ 0 (mod 5), and in view of (4) and (5) we have t ≡ 1 (mod 5). The relation (13) can be written as:

y + 2 · 10^{m}\sqrt{10} = (−3 + 2\sqrt{10}) (19 + 6\sqrt{10})^{t−1} (19 + 6\sqrt{10})
= (63 + 20\sqrt{10}) ((19 + 6\sqrt{10})^{5} )^{(t−1)/5}
≡ 63 + 20\sqrt{10} (mod 281).

Just as in the case a), it follows that 2 · 10^{m} ≡ 20 (mod 281). The relation 10^{m−1} ≡ 1 (mod 281) contradicts the fact that m is even.

3. For a_{8} = 44 ⋯ 49 = x^{2} we have 4 · \frac{10^{k}−1}{9} + 5 = x^{2}. We denote 3x = y and then

4 · 10^{k} + 41 = y^{2}.

For k = 2m, we get the equalities y−2·10^{m} = 1 and y+2·10^{m} = 41, which is a contradiction because m ≥ 2.

For k = 2m + 1 we set z = 2 · 10^{m}, and then y^{2} − 10z^{2} = 41. Whence for y > 0 and z > 0 we get either

y + 2 · 10^{m}\sqrt{10} = (9 − 2\sqrt{10}) (19 + 6\sqrt{10})^{t} ,  (16)

or

y + 2 · 10^{m}\sqrt{10} = (9 + 2\sqrt{10}) (19 + 6\sqrt{10})^{t} ,  (17)

where t is a natural number.

a) It follows by (16) that

2 · 10^{m} = 9b_{t} − 2a_{t}.

Since 2 · 10^{m} ≡ 2 (mod 3), and on the other hand we have by (4) that a_{t} ≡ 1 (mod 3), we get the contradiction 2 ≡ −2 (mod 3).

b) It follows by (17) that

2 · 10^{m} = 2a_{t} + 9b_{t}.  (18)

Then b_{t} ≡ 2a_{t} (mod 5), whence t ≡ 3 (mod 5). We also have b_{t} + 2a_{t} ≡ 0 (mod 4), hence t is odd.

The equality (17) takes the form

y + 2 · 10^{m}\sqrt{10} = (9 + 2\sqrt{10}) (19 + 6\sqrt{10})^{t+2} (19 − 6\sqrt{10})^{2}
= (1929 − 610\sqrt{10}) [(19 + 6\sqrt{10})^{5} ]^{(t+2)/5}
≡ 38 + 48\sqrt{10} (mod 281),

since (t + 2)/5 is odd and (19 + 6\sqrt{10})^{5} ≡ −1 (mod 281).

Thus 2 · 10^{m} ≡ 48 (mod 281), hence (\frac{2·10^{m}}{281} ) = (\frac{48}{281}) . Therefore,

(−1)^{\frac{281^{2}−1}{8} (m+1)} (\frac{5^{m}}{281}) = (\frac{3}{281}) .

We have (\frac{5}{281}) = (\frac{281}{5}) = (\frac{1}{5}) = 1 and (\frac{3}{281}) = (\frac{281}{3}) = (\frac{2}{3}) = −1, hence a contradiction.

4. For a_{13} = 44 ⋯ 4944 = x^{2}, we have 4 · \frac{10^{k}−1}{9} + 500 = x^{2}, that is, y^{2} − 25 · 10^{k−2} = 281, where y = \frac{3}{4}x.

If k = 2m + 2, then (y − 5 · 10^{m})(y + 5 · 10^{m}) = 281, whence y − 5 · 10^{m} = 1 and y + 5 · 10^{m} = 281. One gets the contradiction 10^{m+1} = 280.

If k = 2m + 3, we denote z = 5 · 10^{m}. We have m ≥ 1 and

y^{2} − 10z^{2} = 281  (19)

whence either

y + z\sqrt{10} = (21 + 4\sqrt{10}) (19 + 6\sqrt{10})^{t} , t ∈ ℕ,  (20)

or

y + z\sqrt{10} = (21 − 4\sqrt{10}) (19 + 6\sqrt{10})^{t} , t ∈ ℕ^{∗}.  (21)

a) By (20) it follows that

5 · 10^{m} = 21b_{t} + 4a_{t},

hence 5·10^{m} ≡ 4a_{t} (mod 3). Since a_{t} ≡ 1 (mod 3), we get the contradiction 5 ≡ 4 (mod 3).

b) By (21), if t = 1 then y = 159 and z = 50, whence m = 1 and then k = 5. One thus get the number

44944 = 212^{2}.

For t ≥ 2, it follows that y + \sqrt{10} · 5 · 10^{m} = (159 + 50\sqrt{10}) (19 + 6\sqrt{10})^{s}, s ≥ 1, hence

5 · 10^{m} = 159b_{s} + 50a_{s}.  (22)

For m = 0 and m = 2, equation (19) has no integer solutions, hence we may consider m ≥ 3. We have by (22) that b_{s} ≡ 2a_{s} (mod 8). Hence it follows by (4) and (5) that 6s · 19^{s−1} ≡ 2 · 19^{s} (mod 8). Therefore 3s ≡ 19 (mod 4) and s = 4h + 1. Also by (22) we have 5 · 10^{m} ≡ 159 · 6^{s} · 10^{2h} (mod 19), hence (\frac{5·10^{m}}{19} ) = (\frac{159}{19} ) (\frac{6^{s}}{19}) = (\frac{7}{19}), because (\frac{6}{19}) = 1. Since

(\frac{5}{19}) = (\frac{−14}{19}) = (−1)^{\frac{19−1}{2}} (−1)^{\frac{19^{2}−1}{8}} (\frac{7}{19}) = (\frac{7}{19}) ,

we have (\frac{10^{m}}{19} ) = 1, that is, (\frac{10}{19})^{m} = 1, whence (−1)^{m} = 1. Thus m = 2n.

Equality (19) takes the form

y^{2} = 25 · 10^{2m+1} + 281 = 25 · 10^{4n+1} + 281.

Since 10^{4} ≡ 1 (mod 101), it follows that y^{2} ≡ 250 + 281 (mod 101). Hence y^{2} ≡ 26 (mod 101), whence (\frac{26}{101}) = 1. But (\frac{26}{101}) = (\frac{−75}{101}) = (\frac{3}{101}) = (\frac{101}{3}) = (\frac{2}{3}) = −1, which is a contradiction.

5. For a_{14} = 44 ⋯ 45444 = x^{2} and y = 3x/2 we have the equation:

y^{2} − 10^{k} = 2249.

If k = 2m, m ≥ 3, we have either

y − 10^{m} = 1 and y + 10^{m} = 2249

or

y − 10^{m} = 13 and y + 10^{m} = 173,

and none of these systems has solutions.

If k = 2m + 1, then m ≥ 2. With z = 10^{m} we have the equation:

y^{2} − 10z^{2} = 2249.  (23)

The initial solutions (a, b) of the equation are (57, 10), (147, 44), (153, 46), hence the solutions with y > 0, z > 0 are given by the identities:

\begin{aligned}y + 10^{m}\sqrt{10} & = (57 − 10\sqrt{10}) (19 + 6\sqrt{10})^{t} , & (24) \\ y + 10^{m}\sqrt{10} & = (57 + 10\sqrt{10}) (19 + 6\sqrt{10})^{t} , & (25) \\ y + 10^{m}\sqrt{10} & = (147 − 44\sqrt{10}) (19 + 6\sqrt{10})^{t} , & (26) \\ y + 10^{m}\sqrt{10} & = (147 + 44\sqrt{10}) (19 + 6\sqrt{10})^{t} , & (27) \\ y + 10^{m}\sqrt{10} & = (153 − 46\sqrt{10}) (19 + 6\sqrt{10})^{t} , & (28) \\ y + 10^{m}\sqrt{10} & = (153 + 46\sqrt{10}) (19 + 6\sqrt{10})^{t} , & (29) \end{aligned}

where t ∈ ℕ. We get by (24) that 10^{m} = 57b_{t} − 10a_{t}, hence 10^{m} ≡ −a_{t} (mod 3), which yields the contradiction 1 ≡ −1 (mod 3).

If (27) was true, then 10^{m} = 147b_{t} + 44a_{t}. Since a_{t} ≡ 1 (mod 3) and 10^{m} ≡ 1 (mod 3), the contradiction 1 ≡ 44 (mod 3) follows.

In the case when (28) holds, we get 10^{m} = 153b_{t}−46a_{t}, whence the contradiction 1 ≡ −46 (mod 3).

We still have to study three situations.

a) We have by (25) that

10^{m} = 57b_{t} + 10a_{t}.  (30)

Since m ≥ 2, it follows that b_{t} + 2a_{t} ≡ 0 (mod 4). By (4) and (5) we have 6t(−1)^{t−1} + 2(−1)^{t} ≡ 0 (mod 4). Therefore 3t−1 ≡ 0 (mod 2), and we get that t is odd. It then follows that 19 | a_{t}, and by (30) we deduce the contradiction 19 | 10^{m}.

b) It follows by (26) that

10^{m} = 147b_{t} − 44a_{t}.  (31)

Just as in the case a), by considering congruences (mod 4), we get that t is even.

Also by (31) we have 2b_{t} + a_{t} ≡ 0 (mod 5), whence by (4) and (5) we get t ≡ 3 (mod 5). Then (t + 2)/5 is an even natural number. The relation (26) takes the form

y + 10^{m}\sqrt{10} = (147 − 44\sqrt{10}) (19 + 6\sqrt{10})^{t+2} (19 − 6\sqrt{10})^{2}
≡ (147 − 44\sqrt{10}) (721 − 228\sqrt{10}) (mod 281)
≡ (147 − 44\sqrt{10}) (−122 + 53\sqrt{10}) (mod 281).

It then follows that 10^{m} ≡ 13159 (mod 281) ≡ −48 (mod 281), hence (\frac{10^{m}}{281} ) = (\frac{−48}{281} ). One directly gets a contradiction, observing that (\frac{10}{281}) = (\frac{−1}{281}) = (\frac{16}{281}) = 1 and (\frac{3}{281}) = −1.

c) By (29) we have the equation:

10^{m} = 153b_{t} + 46a_{t}.  (32)

For m = 2, we get the number 102249 which is not a square. Hence m ≥ 3.

For m ≥ 3, we have b_{t} − 2a_{t} ≡ 0 (mod 8), and then t = 4h + 1. Also by (32) we have 3b_{t} + a_{t} ≡ 0 (mod 5), whence t ≡ 2 (mod 5). Therefore (t − 2)/5 is an odd natural number, which in turn implies that (19 + 6\sqrt{10})^{(t−2)/5} ≡ −1 (mod 281). By (29) we have the following relations:

\begin{aligned}y + 10^{m}\sqrt{10} & = (153 + 46\sqrt{10}) (19 + 6\sqrt{10})^{t−2} (19 + 6\sqrt{10})^{2} \\ & ≡ − (153 + 46\sqrt{10}) (−122 − 53\sqrt{10}) (mod 281). \end{aligned}

Then 10^{m} ≡ 13721 ≡ −48 (mod 281), that is, the contradiction from b).

6. For a_{19} = 88 ⋯ 81 = x^{2}, denoting y = 3x we get the equation:

y^{2} = 8 · 10^{k} − 71.

If k = 2m, then m ≥ 3. We denote z = 2 · 10^{m} and get the identity:

y^{2} − 2z^{2} = −71.

It then follows for y, z > 0 that either

y + z\sqrt{2} = (1 + 6\sqrt{2}) (3 + 2\sqrt{2})^{t} ,  (33)

or

y + z\sqrt{2} = (−1 + 6\sqrt{2}) (3 + 2\sqrt{2})^{t} .  (34)

We set (3 + 2\sqrt{2})^{t} = c_{t} + d_{t}\sqrt{2}. For t ≥ 1 we then have the equalities:

\begin{aligned}c_{t} & = 3^{t} + C_{t}^{2} · 3^{t−2} · 2^{2} · 2 + ⋯, & (35) \\ d_{t} & = 2t · 3^{t−1} + C_{t}^{3} · 3^{t−3} · 2^{4} + ⋯ & (36) \end{aligned}

a) We have by (33) that d_{t}+6c_{t} ≡ 0 (mod 8). Then 2t+18 ≡ 0 (mod 8), hence t = 4h+3, whence d_{t} ≡ 2^{t+(t−1)/2} (mod 3). We have z = d_{t} + 6c_{t}. It follows that 2 · 10^{m} ≡ d_{t} (mod 3), hence 2 · 10^{m} ≡ 2^{6h+4} (mod 3), whence 10^{m} ≡ 2^{6h+3} (mod 3), consequently,

(\frac{10^{m}}{3} ) = (\frac{2^{6h+3}}{3} ) = (\frac{2^{3k+1}}{3} )^{2} · (\frac{2}{3}) = −1.

Since (\frac{10^{m}}{3} ) = (\frac{1}{3}), a contradiction follows.

b) For k = 2m, we consider the equality (34) and we have 2 · 10^{m} = −d_{t} + 6c_{t}, hence d_{t} ≡ 6c_{t} (mod 8). It follows that 2t ≡ 18 (mod 8), that is, t = 4h + 1. We then have 2 · 10^{m} ≡ −d_{t} ≡ −2^{4h+1} · 2^{2h} (mod 3). Hence 10^{m} ≡ −(2^{3h})^{2} (mod 3) and (\frac{10^{m}}{3} ) = (\frac{−1}{3} ) = −1 ≠ 1 = (\frac{10^{m}}{3} ).

For k = 2m + 1 we have m ≥ 2. Denoting z = 4 · 10^{m}, we get the equation:

y^{2} − 5z^{2} = −71.

For y, z > 0 we have either

y + z\sqrt{5} = (3 + 4\sqrt{5}) (9 + 4\sqrt{5})^{t} ,  (37)

or

y + z\sqrt{5} = (−3 + 4\sqrt{5}) (9 + 4\sqrt{5})^{t} ,  (38)

where t is a natural number.

We put (9 + 4\sqrt{5})^{t} = e_{t} + f_{t}\sqrt{5} and then

\begin{aligned}e_{t} & = 9^{t} + C_{t}^{2} · 9^{t−2} · 4^{2} · 5 + ⋯, & (39) \\ f_{t} & = 4t · 9^{t−1} + C_{t}^{3} · 9^{t−3} · 4^{3} · 5 + ⋯ & (40) \end{aligned}

It follows by (37) and (38) that z = 4 · 10^{m} = 4e_{t} ± 3f_{t}, hence 4e_{t} ± 3f_{t} ≡ 0 (mod 8). By (39) and (40) we get 4 ± 4t ≡ 0 (mod 8), whence t = 2h + 1.

By 4 · 10^{m} = 4e_{t} ± 3f_{t} we infer 4 · 10^{m} ≡ e_{t} (mod 3). Since t is odd, we have e_{t} ≡ 0 (mod 3), and the contradiction 4 · 10^{m} ≡ 0 (mod 3).

Remarks. It would be interesting to solve the similar problem involving numbers written with respect to some basis b ≥ 2.

It might be more difficult to consider the same problem imposing the condition all-but-one-equal-digits to higher powers, instead of squares.

References

[1] G. Chrystal Algebra. An Elementary Textbook. Part II, Dover, New York, 1961, pp. 478–486.

[2] A. Gica, Algorithms for the equation x^{2}−dy^{2} = k. Bull. Math. Soc. Sci. Math. Roumanie 38(86) (1994-1995), 153–156.

[3] R.E. Mollin, Fundamental Number Theory with Applications. C.R.C. Press, Boca Raton, 1998, pp. 299–302, 232.

[4] I. Niven, H.S. Zuckerman, H.L. Montgomery, An Introduction to the Theory of Numbers. Fifth edition. John Wiley & Sons, Inc., New York, 1991, pp. 346–358.

[5] R. Obláth, Une proprieté des puissances parfaites. Mathesis 65 (1956), 356–364.

2000 Mathematics Subject Classification: Primary 11A63; Secondary 11D09, 11D61. Keywords: square, equal digits, Pell equation

(Concerned with sequence \underline{A018885}.)

Received March 12 2003; revised version received September 15 2003. Published in Journal of Integer Sequences, October 2 2003.

Return to Journal of Integer Sequences home page.