Solving the equation $x-2(S(x))^2=0$, where $S(x)$ represent sum of digits of $x$ and $x$ in an natural number.
Try: Here $n\geq 1$ and $10^{n-1} \leq S(x)<10^n$
I did not understand how to go further
Could some help me how to solve it, Thanks
Solving the equation $x-2(S(x))^2=0$, where $S(x)$ represent sum of digits of $x$ and $x$ in an natural number.
Try: Here $n\geq 1$ and $10^{n-1} \leq S(x)<10^n$
I did not understand how to go further
Could some help me how to solve it, Thanks
Suppose $x$ has $n$ digits. We know $$ 10^{n-1}\le x=2S^2(x)<=2(9n)^2=162n^2 $$ How big can $n$ be? If $n=4,$ we must have $10^3=1000\le 162\cdot 16=2592,$ which is true. If $n=5$ we must have $10^4=10,000\le 162\cdot 25=4050,$ which is false. So, we must have $n\le 4$.
Since $x$ has at most $4$ digits, $S(x)\le 36\implies x=2S^2(x) \le 2592.$
So, we only have to check the values of $x$ up to $2592.$ But we don't have to check all of these. We know that a solution must be of the form $2k^2$ for $k=1,2,\dots,36,$ so there are only 36 numbers to check.
It is possible to cut this down even further using modular arithmetic, which you haven't studied yet, but $36$ numbers is quite doable even with pencil and paper.
I leave the checking to you.
EDIT In response to the OP's comment, I'll give an example. Say $x=7345$. Then $$ x= 7000+300+40+5=7(999+1)+3(99+1)+4(9+1)+5 =\\ 7\cdot 999 + 3\cdot 99 + 4\cdot 9 + 7+3+4+5 = 9k+S(x) $$ Since $10^n$ is always one more than a multiple of $9$ this works no matter how many digits $x$ has.
You can use this fact to cut down the numbers that need to be checked. Since $x$ and $S(x)$ are congruent modulo $9$ we have that $x$ and $2x^2$ are congruent modulo $9$. You can check that this only happens when $x$ is divisible by $9$, or $x$ leaves a remainder of $5$ when divided by $9$.
So which numbers $2k^2$ in our list are divisible by $9$? Those where $k$ is a multiple of $3$. Which ones leave a remainder of $5$? Again, you can check that $k$ must leave a remainder of $5$ also. That is, we have to check the numbers $2k^2$ for $k=3,6,9,\dots,36$ and for $k=5,14,23,32$-- $16$ numbers instead of $36.$ I can't think how to cut it down any further without testing the numbers, but the amount of work left is so small it isn't worth bothering with.