For a positive integer $n$ and nonzero digits $a$, $b$, and $c$, let $A_n$ be the $n$-digit integer each of whose digits is equal to $a$; let $B_n$ be the $n$-digit integer each of whose digits is equal to $b$, and let $C_n$ be the $2n$-digit (not $n$-digit) integer each of whose digits is equal to $c$. What is the greatest possible value of $a + b + c$ for which there are at least two values of $n$ such that $C_n - B_n = A_n^2$?
$\textbf{(A) } 12 \qquad \textbf{(B) } 14 \qquad \textbf{(C) } 16 \qquad \textbf{(D) } 18 \qquad \textbf{(E) } 20$
By geometric series, we have
\begin{alignat*}{8} A_n&=a\bigl(\phantom{ }\underbrace{111\cdots1}_{n\text{ digits}}\phantom{ }\bigr)&&=a\left(1+10+10^2+\cdots+10^{n-1}\right)&&=a\cdot\frac{10^n-1}{9}, \\ B_n&=b\bigl(\phantom{ }\underbrace{111\cdots1}_{n\text{ digits}}\phantom{ }\bigr)&&=b\left(1+10+10^2+\cdots+10^{n-1}\right)&&=b\cdot\frac{10^n-1}{9}, \\ C_n&=c\bigl(\phantom{ }\underbrace{111\cdots1}_{2n\text{ digits}}\phantom{ }\bigr)&&=c\left(1+10+10^2+\cdots+10^{2n-1}\right)&&=c\cdot\frac{10^{2n}-1}{9}. \end{alignat*}
By substitution, we rewrite the given equation $C_n - B_n = A_n^2$ as
\[c\cdot\frac{10^{2n}-1}{9} - b\cdot\frac{10^n-1}{9} = a^2\cdot\left(\frac{10^n-1}{9}\right)^2.\]
Since $n > 0,$ it follows that $10^n > 1.$ We divide both sides by $\frac{10^n-1}{9}$ and then rearrange:
\begin{align*} c\left(10^n+1\right) - b &= a^2\cdot\frac{10^n-1}{9} \\ 9c\left(10^n+1\right) - 9b &= a^2\left(10^n-1\right) \\ \left(9c-a^2\right)10^n &= 9b-9c-a^2. &&(\bigstar) \end{align*}
Let $y=10^n.$ Note that $(\bigstar)$ is a linear equation with $y,$ and $y$ is a one-to-one function of $n.$ Since $(\bigstar)$ has at least two solutions of $n,$ it has at least two solutions of $y.$ We conclude that $(\bigstar)$ must be an identity, so we get the following system of equations:
\begin{align*} 9c-a^2&=0, \\ 9b-9c-a^2&=0. \end{align*}
The first equation implies that $c=\frac{a^2}{9}.$ Substituting this into the second equation gives $b=\frac{2a^2}{9}.$
To maximize $a + b + c = a + \frac{a^2}{3},$ we need to maximize $a.$ Clearly, $a$ must be divisible by $3.$ The possibilities for $(a,b,c)$ are $(9,18,9),(6,8,4),$ or $(3,2,1),$ but $(9,18,9)$ is invalid. Therefore, the greatest possible value of $a + b + c$ is $6+8+4=\boxed{\textbf{(D) } 18}.$
~CantonMathGuy (Solution)
~MRENTHUSIASM (Revision)