a) If $A=\underbrace{111 \ldots 111}_{2 m}$ and $B=\underbrace{444 \ldots 444}_{m}$, verify that the sum $A+B+1$ is a perfect square for any positive integer $m$.

b) If $p=\underbrace{111 \ldots 111}_{l}$ is a prime number, verify that $l$ is also a prime number.

c) Verify that if $x=\underbrace{111 \ldots 111}_{n}$ is divisible by 41, then $n$ is divisible by 5.

d) If

$$
y=\underbrace{\sqrt{111 \ldots 111}}_{2 n \text { times }} \cdot 10^{n}
$$

find the largest positive integer that is not greater than $y$.
Solution

a) Observe that $\underbrace{11 \ldots 11}_{2 m}=\frac{10^{2 m}-1}{9}$, because

$$
\begin{aligned}
& \underbrace{11 \ldots 11}_{k}= \\
& 10^{k}+10^{k-1}+\cdots+10^{1}+10^{0}= \\
& =\frac{10^{k}-1}{9}
\end{aligned}
$$

Thus, we have

$$
\begin{aligned}
\underbrace{44 \ldots 44}_{m} & =4 \cdot \underbrace{11 \ldots 11}_{m} \\
& =4 \cdot\left(\frac{10^{m}-1}{9}\right) .
\end{aligned}
$$

This generates

$$
\begin{array}{r}
A+B+1= \\
\frac{10^{2 m}-1}{9}+4 \cdot \frac{\left(10^{m}-1\right)}{9}+\frac{9}{9}= \\
\frac{10^{2 m}-1+4 \cdot 10^{m}-4+9}{9}= \\
\frac{\left(10^{m}\right)^{2}+2 \cdot 2 \cdot 10^{m}+2^{2}}{9}= \\
=\left(\frac{10^{m}+2}{3}\right)^{2}
\end{array}
$$

Since the number $10^{m}+2$ is a multiple of 3, because the sum of its digits is a multiple of 3, the expression is a perfect square.

b) Suppose that $l$ is a composite number, i.e., $l=m \times n$, with $m, n>1$. Then we can factor $p$ as follows:

$$
x=\underbrace{11 \ldots 11}_{n} \cdot 1 \underbrace{00 \ldots 0}_{n-1} 1 \ldots 1 \underbrace{00 \ldots 0}_{n-1} 1
$$

with $m-1$ groups of zeros. Therefore, $p$ would not be prime. It is worth noting that the converse is not true, as 111 has a number of digits given by a prime number, but $111=3 \cdot 37$ is a composite number.

c) By the Division Algorithm, we can write $n=5 q+r$, with $r \in\{0,1,2,3,4\}$, and

$$
\begin{array}{r}
\underbrace{11 \ldots 1}_{n \text { times }}= \\
\underbrace{11 \ldots 1}_{5 q \text { times } r \text { times }}+\underbrace{11 \ldots 1}_{r \text { times }}= \\
\underbrace{11 \ldots 1} 100001 \ldots 00001+\underbrace{11 \ldots 1}_{r \text { times }} .
\end{array}
$$

Since $11111=41 \cdot 271$, the remainder that $x$ leaves when divided by 41 is the same as $\underbrace{11 \ldots 1}_{r \text { times }}$. Analyzing the division of the numbers in the set $\{1,11,111,1111,1111\}$ by 41, we note that none of them are divisible by 41. Therefore, for $x$ to be a multiple of 41, we must have $r=0$ and thus $n$ must be a multiple of 5.
d) Let $k=\underbrace{111 \ldots 111}_{2 n \text { times }}$, then

$$
\begin{aligned}
9 k & 10^{2 n}+1 \\
9 k^{2}+6 k & >10^{2 n} k+k \\
9 k^{2}+6 k+1 & >10^{2 n} k+k+1 \\
& >10^{2 n} k \\
& =y^{2}
\end{aligned}
$$

Thus, it follows that $(3 k+1)^{2}>y^{2}$, or $3 k+1>y$. Therefore,

$$
3 k<y<3 k+1
$$

and the greatest integer not greater than $y$ is

$$
3 k=\underbrace{333 \ldots 33}_{2 n \text { times }} .
$$

Note: A number of the form $\underbrace{11 \ldots 111}_{n \text { times }}$ is commonly called a Repunit, a term derived from the expression "repeated unit" and coined in 1966 by Albert H. Beiler in his book Recreations in the Theory of Numbers.