# Proving $ab+1$ is always a square, where $a = 111\ldots1$ with $n$ "$1$"s, and $b = 1000\ldots05$ with $n-1$ "$0$"s [closed]

How can I prove that this expression is always a square? : $$ab+1$$ when $$a = 111\ldots1$$ with $$n$$ "$$1$$"s, and $$b = 1000\ldots05$$ with $$n-1$$ "$$0$$"s.

I am learning about number bases, and I cannot wrap my head around this proof question.

It would be helpful if you could

1. integrate number bases in the answers

2. indicate how many repetitions you are stating if you use this symbol : "..."

Thanks!

• What have you tried? A natural first step would be to look at small $n$. What is the square root in those cases? Can you then generalize the pattern?
– lulu
Jul 23, 2021 at 15:34
• Observe, that $\underbrace{1\ldots 1}_{n\ \text{times}}=\frac{b^n-1}{b-1}$ and $1\underbrace{0\ldots 0}_{n-1\ \text{times}}5=b^n+5$ for $b=10$. Here $b=10$ is your base. Jul 23, 2021 at 15:39
• tangentially: repunits Jul 23, 2021 at 16:25
• By "$ab$", do you mean the product or the concatenation of $a$ and $b$? Jul 23, 2021 at 16:54

Notice that the product $$ab$$ will always be in the form $$\underbrace{1 \ldots1}_{n \text{ times}} \underbrace{5 \ldots5}_{n \text{ times}}$$. This can be seen by writing the product as

$$(10^n + 5)(10^{n-1} + \ldots + 10 + 1) = 10^{2n-1} + \ldots + 10^{n} + 5(10)^{n-1} + \ldots + 5(10) + 5$$

From there, we can take square roots for small cases and notice that $$34^2 = 1156, 334^2 = 111556, \ldots$$, and we can make the guess that the square root of $$ab+1$$ is $$\underbrace{3\ldots 3}_{n-1 \text{ times}}4$$. To verify this, we denote the number $$\underbrace{3\ldots 3}_{n-1 \text{ times}}4$$ as $$c$$, and see that

$$c^2 - 1 = (c+1)(c-1) = (\underbrace{3\ldots 3}_{n-1 \text{ times}}5)(\underbrace{3\ldots 3}_{n \text{ times}}) = 3(\underbrace{3\ldots 3}_{n-1 \text{ times}}5)(\underbrace{1\ldots 1}_{n \text{ times}}) = (1\underbrace{0 \ldots 0}_{n-1 \text{ times}}5)(\underbrace{1\ldots 1}_{n \text{ times}}) = ab$$

as desired.

It helps to rewrite:

$$a = 111......1$$

$$9a = 9999......9$$

$$9a + 1 = 100000..... 0= 10^n$$

$$a = \frac{10^n - 1}9$$.

And

$$b = 10000....5 = 1000....0 + 5 = 10^n+5$$.

So you are being asked to prove

$$ab+1 = (\frac {10^n -1}9)(10^n + 5) + 1$$ is a always a perfect square.

well

$$ab+1 = (\frac {10^n -1}9)(10^n + 5) + 1=$$

$$\frac {(10^n-1)(10^n + 5)}9 + 1 =$$

$$\frac {10^{2n} +4\times 10^{n} -5}9+ \frac 99=$$

$$\frac {10^{2n} + 4\times 10^n - 5 + 9}9 =$$

$$\frac {10^{2n} +4\times 10^n + 4}9 =$$

$$\frac {(10^n + 2)^2}{3^2}=$$

$$(\frac {10^n + 2}3)^2=$$

$$(\frac {100000....2}3)^2=$$

$$3333.....34^2$$.

• Silly typos : $$\frac {10^{2n} + 2\times 10^n - 5 + 9}9$$$$\frac {10^{2n} +2\times 10^2 + 4}9$$ Jul 23, 2021 at 17:47
• Ooh.... had to look at your message a few times to see the typo..... Jul 23, 2021 at 18:41
• But you have not corrected the first typo yet, you have only corrected the second one. Look at $2\times10^n$, are you sure $2$ is correct ? Jul 23, 2021 at 20:03

Jochen method :

Since $$\;a=\dfrac{10^n-1}9\;$$ and $$\;b=10^n+5\;,\;$$ it follows that

\begin{align} ab+1&=\dfrac{\big(10^n-1\big)\big(10^n+5\big)}9+1=\dfrac{10^{2n}+4\cdot10^n-5+9}9=\\ &=\dfrac{10^{2n}+4\cdot10^n+4}9=\dfrac{\big(10^n+2\big)^2}9=\\ &=\left(\dfrac{10^n+2}3\right)^2\;. \end{align}

Hence $$\;ab+1\;$$ is always a square.

• Silly nitpick.... how do you know $\frac {10^n + 2}3$ is an integer? (There's two obvious answers but....) Jul 23, 2021 at 17:25
• Yes, you are right, there are two obvious answers.$\qquad\qquad$ First answer: since the sum of the digits of $10^n+2$ is $3$, then $10^n+2$ is multiple of $3$, hence $\dfrac{10^n+2}3$ is integer. $\qquad$ Second answer: if $\dfrac{10^n+2}3$ were not integer, then its square would not be integer, but it is a contradiction because $ab+1$ is integer. Jul 23, 2021 at 17:33
• What did you mean when you wrote “but….” ? Jul 23, 2021 at 17:41
• I just meant that you technically haven't shown it's a perfect square of an integer. Just that its a perfect square of a value. It's a minor point as it's clear that $10^{2n}+4\cdot10^n-5+9$ is clearly divisible by $9$ so $\sqrt{10^{2n}+4\cdot10^n-5+9} = 10^n + 2$ would have to be divisible by $3$. (I guess that's the third and in this case most pertinent argument). Jul 23, 2021 at 18:46
• Why have you downvoted me ? My answer is correct. Jul 24, 2021 at 7:43