[Math] Why do the digits of a number squared follow a similar quotient

number theory

I realized that, any number $k$ with $n$ digits, and when $k$ is squared, i.e $k^2$ will have $2n-1$ or $2n$ digits.

Per example, let $k = 583$, thus $n = 3$ and the digits of $583^2$ are $2n$.

But I started thinking, how can I narrow the result to be more precise?

But, I asked myself. How can I determine when I will have $2n-1$ or $2n$ digits?

What I did was the following:

$1)$ The last number of $1$ digit whose square has $2n-1$ digits, is $3$ since $3^2 = 9$, and the next number $4^2 = 16$ have $2n$ digits. And the quotient between the max numbers of $1$ digit($9$) and the last number of $1$ digit to the pow of $2$ with $2n-1$ digits(3) is: $9/3 = 3$

$2)$ The last number of $2$ digits whose square has $2n-1$ digits, is $31$, since $31^2 = 961$. The quotient here is $3.19354839$

$3)$ The last number of $3$ digits whose square has $2n-1$ digits, is $316$ since $316^2 = 99856$. The quotient here is $3.16139241$

$4)$ The last number of $8$ digits whose square has $2n-1$ digits, is $31622776$, since $31622776^2 = 9.9999996\cdot10^{14}$. The quotient here is $3.16227768871$

The quotient is each time smaller and closer to $3.16$

$i)$ Why does the quotient between the largest number with $n$ digits and the last number with $n$ digits squared that have $2n-1$ follow this "pattern" closer and closer to $3.16$?

$i)$ With this I can assure for all numbers that: If i have a number, per example $k = 7558$ and $k$ have $4$ digits and the quotient between $9999/7558 < 3.2$, then $k$ have $2n = 8$ digits?

That more generally, I can assure you this?:

If i have a number $k$ with $n$ digits, this number have
$2n$ digits if $\frac{10^{n}-1}{k} \leq 3.2$ otherwise it will have $2n-1$
digits

Best Answer

If $k^2$ has $2n$ digits, then it is true that $10^{2n-1} \leq k^2 < 10^{2n}$, so we have $10^{n-1}\sqrt{10} = \sqrt{10^{2n-1}} \leq k < \sqrt{10^{2n}} = 10^n$.

If $k^2$ has $2n-1$ digits, then it is true that $10^{2n-2} \leq k^2 < 10^{2n-1}$, so we have $10^{n-1} = \sqrt{10^{2n-2}} \leq k < \sqrt{10^{2n-1}} = 10^{n-1}\sqrt{10}$.

So the cutoff you've observed is exactly at $\sqrt{10} \approx 3.162277660168379332$, times powers of 10.