Let $ b$ be an integer greater than $ 5$. For each positive integer $ n$, consider the number \[ x_n = \underbrace{11\cdots1}_{n - 1}\underbrace{22\cdots2}_{n}5, \] written in base $ b$. Prove that the following condition holds if and only if $ b = 10$: there exists a positive integer $ M$ such that for any integer $ n$ greater than $ M$, the number $ x_n$ is a perfect square. Proposed by Laurentiu Panaitopol, Romania
Problem
Source: German TST 2004, IMO ShortList 2003, number theory problem 4
Tags: modular arithmetic, number theory, decimal representation, Perfect Square, IMO Shortlist
19.05.2004 15:50
As far as I know, it was proposed by Laurentiu Panaitopol, whom I consider one of the most proeminent problem creator and solver. And I definitely don't agree with you, Darij, when you say it's from hell. It is a very beautiful problem with a very beautiful idea.
19.05.2004 16:02
Well, if there is a beautiful idea, then I would change my opinion, but none of the other TST participants had a beautiful solution. (I even didn't have any solution at all, except of the very simple proof that the assertion is true for b = 10.) In general, I seldomly find number theory problems about digital systems beautiful, but this is just my opinion. Darij
22.05.2004 12:29
I think I have a solution. Suppose b<>10. Also b<>2 By an easy observation, the problem reduces to (2b^n+b)^2+(b-2)(b-10)=(b-1)a_n^2 If b-1 is perfect square, then so is (2b^n+b)^2+(b-2)(b-10) so (b-2)(b-10)=0 which gives b=10. So b-1 is not perfect square Hence 2b^n+b, a_n are solutions to a generalised Pell equation. Let 2b^n+b=u_k, a_n=v_k,2b^(n+1)+b=u_l,a_(n+1)=v_l (where u_i,v_i are solutions to Pell's equation). It's well-known that u_l=pu_k+qv_k, for some p,q dependent of l-k. Since u_(k+1)/u_k tends to a constant, l-k and p,q will stabilise. Hence we get 2b^(n+1)+b=p(2b^n+b)+q(a_n) for FIXED p,q. Since a_n/(2b^n+b) tends to 1/sqrt(b-1), divinding by 2b^n+b and passing to limit we get b=p+q/sqrt(b-1) which is possible only if b-1 is perfect square. But we have already solved this case
02.06.2010 00:07
26.05.2011 21:51
$b^{2n} + b^{n+1} - 2b + 45$ isn't correct, for $n=1,b=1$ he says $1225=15^2$ instead of $35^2$ hence here again wrong solution posted..??
26.05.2011 22:32
Of course, the correct value of the expression is $\dfrac {b^{2n} + b^{n+1} - 2b + 5(b-1)} {b-1} = \dfrac {b^{2n} + b^{n+1} + 3b - 5} {b-1}$; he forgot the denominator $b-1$ and confusedly used $b=10$ in order to have $45$ instead of $5(b-1)$. But in your objection, you write $b=1$ instead of $b=10$, and miscalculate the case $n=1$, when the number is $25 = 5^2$ with the case $n=2$, when the number is $1225 = 35^2$. Of course, his formula misfires in both cases, because of the forgotten denominator; for $n=1$ he has $15^2$ (instead of the correct $15^2/9 = 5^2$), and for $n=2$ he has $105^2$ (instead of the correct $105^2/9 = 35^2$). Also, no need to entirely quote the post just above yours (which I here and now have removed).
21.06.2011 02:29
Taking the number $\pmod{b-1}$, we have $n-1+2n+5\equiv3n+4\pmod{b-1}$ a quadratic residue for all sufficiently large $n$, so $b-1$ has only prime factors of $2,3$, and $4$ does not divide $b-1$. Suppose $b-1$ is not a perfect square. We're left with $b-1\in\{2\cdot3^k,3^{2k+1}\}$. But $x_{2m+1}\equiv5-2=3\pmod{b+1}$ must be a quadratic residue for sufficiently large $m$, contradicting the fact that $4|2\cdot3^k+2$ and $3$ is not a quadratic residue $\pmod{3^{2k+1}+2}$ according to Jacobi symbol evaluation. Edit: If $b-1$ is a perfect square, we use the bounding argument outlined in previous posts.
14.04.2016 17:47
Not much different, but anyways... (hoping no one minds the revive) Let us define a sequence of non negative integers $(x_n)_{n \in \mathbb{N}}$ such that $x_n^2=\frac{b^{2n}+b^{n+1}+3b-5}{b-1}$. Now, notice that $\lim_{n \longrightarrow +\infty}(bx_n-x_{n+1})=\frac{b\sqrt{b-1}}{2}$ and so, the sequence $(bx_n-x_{n+1})$ converges to a limit $l=\frac{b\sqrt{b-1}}{2}$. Thus, we immediately get that $b$ is of the form $a^2+1$ for some integer $a>0$ and now, we get that there exists a constant $M>>0$ such for all $n>M$, we have $bx_n=x_{n+1}+\frac{b\sqrt{b-1}}{2}$ and now, we get that $b^2 \mid 4(3b-5)$. Solving this, we see that the only $b$ of the desired form with $b>4$ is $b=10$. For $b=10$, $x_n=\frac{10^n+5}{3}$ works.
27.06.2016 06:13
Fantastic
05.03.2018 21:38
anantmudgal09 wrote: Not much different, but anyways... (hoping no one minds the revive) Let us define a sequence of non negative integers $(x_n)_{n \in \mathbb{N}}$ such that $x_n^2=\frac{b^{2n}+b^{n+1}+3b-5}{b-1}$. Now, notice that $\lim_{n \longrightarrow +\infty}(bx_n-x_{n+1})=\frac{b\sqrt{b-1}}{2}$ and so, the sequence $(bx_n-x_{n+1})$ converges to a limit $l=\frac{b\sqrt{b-1}}{2}$. Thus, we immediately get that $b$ is of the form $a^2+1$ for some integer $a>0$ and now, we get that there exists a constant $M>>0$ such for all $n>M$, we have $bx_n=x_{n+1}+\frac{b\sqrt{b-1}}{2}$ and now, we get that $b^2 \mid 4(3b-5)$. Solving this, we see that the only $b$ of the desired form with $b>4$ is $b=10$. For $b=10$, $x_n=\frac{10^n+5}{3}$ works. What was the motivation for calculating $\lim_{n \longrightarrow +\infty}(bx_n-x_{n+1})=\frac{b\sqrt{b-1}}{2}$?
22.09.2019 19:19
Note that $x_n=\frac{b^2n+b^{n+1}+3b-5}{b-1}=b^{n+1}(b^{n-2}+...+b+1)+2b(b^{n-1}+...+b+1)+5$, which can also be rewritten as $\frac{(2b^n+b)^2-(b-2)(b-10)}{4(b-1)}$. Choose any prime $p|b-1$: then $x_n\equiv 1(n-1)+2(n)+5\equiv 3n+4\mod{p}$ must always be a quadratic residue, so thus $p=2, 3$; also, $3\cdot 1+4\equiv 3 \pmod{4}$ which is not a QR, meaning that $b=3^k+1, 2\cdot 3^{2k}+1$. Now we will do some cases. 1.) $b=2\cdot 3^k+1$. Then note that for odd $n$, we can use our second representation of $x_n$ to find $x_n\equiv 1(0)+2(-1)(1)+5\equiv 3\pmod{b+1}$, so 3 is a QR mod $b+1$. Note that $4|2\cdot 3^k+2=b+1$, so 3 is a QR mod 4, which is not true. Thus no solutions. 2.) $b=3^k+1$, $k$ is odd. Then note that $x_n\equiv \frac{(-1)^{2n}+(-1)^{n+1}-3-5}{-2}\equiv 3\pmod{b+1}$ for all odd $n$. Thus 3 is a QR mod $p$ for all prime $p|b+1$, and since $3\nmid b+1$, $p\equiv \pm 1\pmod{12}$. Thus $b+1=3^k+2\equiv \pm 1\pmod{12}$, so $3^k\equiv -3\pmod{12}$, meaning $3^{k-1}\equiv -1\pmod{4}$, which is a contradiction since $k$ is odd. So no solutions for this case. 3.) $b=3^k+1$, $k$ is even. Then $b-1$ is a square, meaning that for all $n>M$, $(2b^n+b)-(b-2)(b-10)$ is a square (using our third representation of $x_n$). This means $(b-2)(b-10)$ can be expressed as a difference of squares in infinitely many ways, and if it is nonzero it will have finitely many factors so that would be impossible. Thus $(b-2)(b-10)=0$, so $b=10$ is our only solution here. Now note that for $b=10$, $x_n=(\frac{10^n+5}{3})^2$, so $b=10$ works and it is the only solution, as desired.
29.09.2019 15:32
Lol this is just a buffed version of 2018 amc 10a #25
20.05.2020 05:38
{{delete| delete this}}
12.08.2020 13:01
A really ugly solution. When $b=10$ we have $$x_n=(\frac{10^n+5}{3})^2$$Now, suppose $b\neq 10$. CLAIM 1. $2b+5$ is a perfect square. Proof. Notice that $$x_n=\underbrace{11\cdots1}_{n - 1}\underbrace{22\cdots2}_{n-1}25=\frac{b^{n-1}-1}{b-1}\cdot b^2(b^{n-1}+2)$$Now, for every prime $p|b$, $2b+5$ is a quadratic residue modulo $p$. For every prime $p\nmid b$, by lifting the exponent we can pick sufficiently large $n$ such that $$p|\frac{b^{n-1}-1}{b-1}$$hence $2b+5$ is a quadratic residue modulo $p$, which implies $2b+5$ is a quadratic residue modulo every prime, which implies that it must be a perfect square. $\blacksquare$ In particular we have $2b+5\equiv 1\pmod 8$ hence $b\equiv 2\pmod 4$ Now let $y_n=\sqrt{x_n}$ and $z_n=by_n-y_{n+1}$ CLAIM 2. $$\frac{b}{2}<z_n<b^{\frac{3}{2}}$$for sufficiently large $n$. Proof. Notice that we have $$b^2y_n^2-y_{n+1}^2=\underbrace{11\cdots1}_{n - 1}\underbrace{22\cdots2}_{n}500-\underbrace{11\cdots1}_{n}\underbrace{22\cdots2}_{n+1}5=b^{n+2}+3b^2-2b-5=b^{n+2}+(3b-5)(b+1)$$Meanwhile, we have \begin{align*} b^{2n+2}>b^2y_n^2&>y_{n+1}^2>b^{2n+1}\\ b^{n+1}>by_n&>y_{n+1}>b^{n+\frac{1}{2}}\\ \end{align*}Therefore $$2b^{n+1}>by_n+y_{n+1}>2b^{n+\frac{1}{2}}$$For sufficiently large $n$ we have $$b^{n+2}<b^{n+2}+3b^2-2b-5<2b^{n+2}$$Therefore $$\frac{b}{2}<\frac{b^{n+2}+3b^2-2b-5}{by_n+y_{n+1}}=z_n<b^{\frac{3}{2}}$$as desired. Now if $b$ has no prime factor other than $2,5$, then from CLAIM 1 we can easily deduce that $b=10$. Hence suppose there exists $p\neq 2,5$ so that $p|b$. CLAIM 3. Let $C=b^{\frac{3}{2}}$. For each integer $n$, consider the set $$A_n=\{a|0\leq |a-y_n|\leq 2c\}$$then there exists $\alpha\in\mathbb N$ such that $p^{\alpha}\nmid a$ for all $a\in A_n$, where $n>N$. Proof. Notice that if $|a-y_N|=i$ and $p^\alpha|a$ then $x_n\equiv y_n^2\equiv i^2\pmod{p^\alpha}$. Now $x_n-i^2$ has its fifth digit in base $b$ equals to $2$, hence nonzero modulo $p$. Therefore $\alpha=v_p(x_n-i^2)\leq 5v_p(b)$ which is bounded. Therefore we can always took a sufficiently large $\alpha$. $\blacksquare$ CLAIM 4. $z_n$ is a constant for sufficiently large $n$. Proof. Suppose on the contrary that $z_{n+1}\neq z_n$ for sufficiently large $n$. Notice that $$y_n^2\equiv y_{n+1}^2\equiv y_{n+2}^2\pmod{p^{\alpha}}$$Let $y_{n+1}=k$, then from $(y_n,p)=1$, $y_n$ and $y_{n+2}$ all equals to $\pm k$ modulo $p$. Now \begin{align*} z_n&=by_n-y_{n+1}\\ z_{n+1}&=by_{n+1}-y_{n+2}\\ \end{align*}Now notice that $\{z_n\}$ is bounded, and that $\alpha$ is chosen to be sufficiently large, therefore $z_n\neq \pm z_{n+1}\pmod {p^{\alpha}}$ CASE I: $y_n=-k\pmod{p^{\alpha}}$ Since $z_{n+1}\neq z_n$ we must have $y_{n+2}\equiv k\pmod{p^{\alpha}}$. Therefore $$z_n-z_{n+1}\equiv 2y_{n+1}\pmod{p^{\alpha}}$$it is easy to see that $z_n-z_{n+1}$ is even , hence $p^{\alpha}|y_{n+1}-\frac{z_n-z_{n+1}}{2}$. However $y_{n+1}-\frac{z_n-z_{n+1}}{2}\in A_{n+1}$. This contradicts the definition of $\alpha$. CASE II: $y_n=-k\pmod{p^{\alpha}}$ This is similar to CASE I, since $z_{n+1}\neq z_n$ we must have $y_{n+2}\equiv-k\pmod{p^{\alpha}}$. Therefore $$-(z_n+z_{n-1})\equiv 2y_{n+1}\pmod{p^\alpha}$$it is easy to see that $z_n+z_{n+1}$ is even , hence $p^{\alpha}|y_{n+1}+\frac{z_n+z_{n+1}}{2}$. However $y_{n+1}+\frac{z_n+z_{n+1}}{2}\in A_{n+1}$. This contradicts the definition of $\alpha$. $\blacksquare$ Now we have $z_n=z$ for sufficiently large $n$. Notice that for every $k$ we have $$z|b^2y_k^2-y_{k+1}^2=b^{k+2}+(3b-5)(b+1)$$replace $k$ by $k+1$, we have $$z|b^{k+3}+(3b-5)(b+1)$$Hence $z|b^{k+2}(b-1)$. Let $d=(z,b^{k+2})$ and $e=(z,b-1)$, then $z=de$. Moreover $d|(3b-5)(b+1)$ which implies $d|3b-5$, so $d$ is a power of $5$. Moreover $e|(1)^{k+3}+(3(1)-5)2=-3$, so $e=3$. Therefore if $5\nmid b$ we must have $z\geq 3$. From CLAIM 2 we have $b\geq 5$, which is a contradiciton. Therefore $5|b$, from CLAIM 1 we have $2b+5=(10k+5)^2$ for some $k\in\mathbb N$. Therefore $$d|3b-5=25(6k^2+6k+1)$$we can see that $6k^2+6k+1=0$ has no solution in $\mathbb F_5$, hence $v_p(d)\leq 2$, which implies $d\leq 25$. Since $z=de$ we have $z\leq 75$ and $b<150$. This implies the only possibility of $b$ is $\frac{25^2-5}{2}=110$, which can be easily checked to be not a solution. This completes the proof.
22.10.2021 11:39
To begin with, let's write $x_n$ in base $b.$ We have \[x_n=\underbrace{11\cdots1}_{n - 1}\underbrace{22\cdots2}_{n}5=\big(b^{2n-1}+...+b^{n+1}\big)+2\big(b^{n}+...+b\big)+5\]which further rewrites as \[x_n=\frac{b^{2n}+b^{n+1}+3b-5}{b-1}\]Observe that $b^x=(b-1+1)^x\equiv (b-1)x+1\bmod{(b-1)^2}$ by the binomial expansion. Hence, we get that \[x_n\equiv\frac{(b-1)(3n+1)+2+3b-5}{b-1}\equiv 3n+4\pmod{(b-1)^2}.\]Now, assume that there exists $M$ with the desired property. Choose some $n>M$ such that $3n+4\equiv b-1\bmod{(b-1)^2}$ and we get that $x_n\equiv (b-1)\bmod{(b-1)^2}.$ In other words, for any prime $p$ dividing $b-1, \nu_p(x_n)=\nu_p(b-1).$ Hence, $b-1$ is a perfect square. Since $b-1$ is a perfect square it follows that for all $n>M, \ b^{2n}+b^{n+1}+3b-5$ is a perfect square so $4(b^{2n}+b^{n+1}+3b-5)$ is a perfect square. The letter, however, can be rewritten as: for all $n>M$, $(2b^n+b)^2-(b^2-12b+20)$ is a perfect square. Now, if $b>10$ then $b^2-12b+20>0$ so because $(2b^n+b)^2-(b^2-12b+20)$ for all $n>M$ is follows that \[\forall \ n>M, \ (2b^n+b)^2-(b^2-12b+20)\leq (2b^n+b-1)^2\iff\]\[\iff \forall \ n>M, \ 4b^n+2b-1<b^2-12b+10\]which is an obvious contradiction, as the RHS is a constant while the LHS tends to infinity. Similarly, if $b<10$ (and we know $b>5$) we get that $b^2-12b+20<0$ so \[\forall \ n>M, \ (2b^n+b)^2-(b^2-12b+20)\geq (2b^n+b+1)^2\iff\]\[\iff \forall \ n>M, \ -(b^2-12b+10)>4b^n+2b+1\]which is, yet again, a clear contradiction since the LHS is constant and the RHS tends to infinity. Therefore, if the constant $M$ exists, $b$ must be $10.$ And indeed, if $b=10, M=1$ works since \[x_n=\frac{b^{2n}+b^{n+1}+3b-5}{b-1}=\frac{\big(10^n+5\big)}{9} \ \square\]
03.08.2022 00:35
If we take the number mod $b-1$, then it is the sum of the digits, $n-1+2(n)+5=3n+4.$ This must be a quadratic residue for all sufficiently large $n$. Thus, $4\nmid b-1$. If $b-1$ had a prime factor $p>3$ then $3n+4$ is a complete remainder system mod $p$ which is a contradiction. Thus, $b-1=2\cdot 3^k$ or $b-1=3^k.$ If we take the number mod $b+1$, then it is the alternating sum of the digits. If $n$ is odd, then it is equivalent to $3\pmod b+1.$ This implies that $3$ is a quadratic residue mod $b+1.$ $b+1=2\cdot 3^k+2$ obviously won't work because then $4\mid b+1$ and $3$ is not a quadratic residue mod $4.$ Let $b+1=3^k+2$ then \[\left(\frac{3}{3^k+2}\right)\left(\frac{2}{3}\right)=\left(-1\right)^{\left(\frac{3^k+1}{2}\right)}\]and since $2$ is a quadratic nonresidue mod $3$, $3$ is a quadratic residue mod $b+1$ only if $4\nmid b$ which implies that $k$ is even. Thus, $b-1$ is a perfect square, which implies that $(b-1)x_n=b^{2n}+b^{n+1}+3b-5$ is a perfect square. Now, $b$ is odd so we see \[\left(b^n+\frac{b}{2}\right)^2=b^{2n}+b^{n+1}+\frac{b^2}{4}\]Let $(b-1)x_n=i^2$ and $\left(b^n+\frac{b}{2}\right)^2=j^2$ for positive $i,j$ and $i\neq j$ then $i^2-j^2\ge i+j> b^n.$ For sufficiently large $n$, $b^n$ is far bigger than $\frac{b^2}{4}-3b+5.$ Thus, $i=j$ and so $b^2-12b+20=0$ which implies $b=2$ or $10.$ Only $b=10$ matters.
14.07.2023 18:33
Solved with cj13609517288. We can take $x_n$ modulo $b-1$ and get $3n + 4$ is a quadratic residue modulo $b-1$. This implies that $3n+4$ is a QR modulo any divisor of $b-1$. If some prime $p> 3$ divided $b-1$, then $3n +4 $ forms a complete residue set modulo $p$ for sufficiently large $n$, which means it won't always be a QR. If $4$ divided $b-1$, then $3n + 4\equiv 3\pmod 4$ for any $n\equiv 1\pmod 4$. Since $3$ is not a QR modulo $4$, this is a contradiction, so $4\nmid b-1$. Therefore $b - 1 = 3^k$ or $2\cdot 3^k$ for some positive integer $k$. Now we have \[x_n = (b^{2n-1} +\cdots + b^{n+1}) + 2(b^n + b^{n-1} + \cdots + b) + 5 = \frac{b^{2n} + b^{n+1} + 3b - 5}{b-1}, \]so $(b^{2n} + b^{n+1}+ 3b - 5)(b-1)$ must be a perfect square for sufficiently large $n$. Taking this modulo $b + 1$ for any odd $n$, we get $(1 + 1 - 3 - 5)\cdot (-2) = 12$ is a quadratic residue mod $b +1 $, so $3$ is a QR mod $b + 1$. If $b - 1 = 2\cdot 3^k$, then $4\mid b + 1$, and $3$ is not a QR modulo $4$, absurd. So $b = 3^k + 1$ for some $k$. If $3^k + 2\equiv 1\pmod 4$, then \[ \left( \frac{3}{b + 1} \right) = \left( \frac{3}{3^k + 2} \right) = \left( \frac{3^k + 2}{3} \right) = \left( \frac{2}{3} \right) = -1\] Therefore, $3^k + 2\equiv 3\pmod 4$, so $k$ is even. Now since $b - 1 = 3^k$ is a perfect square (because $k$ is even), we get that $b^{2n} + b^{n + 1} + 3b - 5 $ is a perfect square. Thus, \[(2b^n+b)^2-(b^2-12b+20) = 4(b^{2n} + b^{n + 1} + 3b - 5) \]is a perfect square also. Now, the difference between $(2b^n + b)^2$ and the closest other perfect square to it is $2(2b^n + b) - 1$, which exceeds $|b^2 - 12b + 20|$ for sufficiently large $n$. This implies that $b^2 - 12b + 20 = 0$ must hold, so $b=2$ or $b=10$. Since $b>5$, $b=10$. To see that $b = 10$ works, we get that \[x_n = \frac{10^{2n} + 10^{n+1} + 25}{9} = \left( \frac{2\cdot 10^n + 10 }{6} \right) ^2,\]so it is always a perfect square.
14.04.2024 21:21
I didn't actually compute/justify the asymptotic stuff when solving, so there is a good chance that this fails horribly if you actually do the computations. Feel like this works, but too sleep deprived to check.
approximation for large $n$, we can obtain $$y_{n + 2} - (b + 1)y_{n + 1} + by_n \rightarrow 0.$$Integer sequence stuff implies that equality eventually holds. Thus, we can solve this linear recurrence to obtain $y_n = a\cdot b^n + c$ for sufficiently large $n$. But, in order for the first approximation to be so good for all large $n$, we actually need $a = \frac{1}{\sqrt{b - 1}}$ and $c = \frac{b}{2\sqrt{b-1}}$, so $$\left(\frac{b^n - \frac{b}{2}}{\sqrt{b-1}}\right)^2 = \frac{b^{2n}+b^{n+1}+3b-5}{b-1} \implies b \in \{2,10\}.$$Only $10$ works.