# For any given even number sqrtA that has m digits and A with n digits, is there a relationship between m and n?

• if $n$ is even, $m = \frac{n}{2}$
• if $n$ is odd, $m = \frac{n + 1}{2}$

where $m$ is the number of digits in $\sqrt{A}$

#### Explanation:

Let's first look at a few terms and see if we can spot a pattern (I'm including the variable $m$ which is the number of digits in $\sqrt{A}$):

$\left(\begin{matrix}A & n & \sqrt{A} & m \\ 4 & 1 & 2 & 1 \\ 16 & 2 & 4 & 1 \\ 36 & 2 & 6 & 1 \\ 64 & 2 & 8 & 1 \\ 100 & 3 & 10 & 2 \\ 144 & 3 & 12 & 2 \\ \vdots & \vdots & \vdots & \vdots\end{matrix}\right)$

Since $A$ is even, then $\sqrt{A}$ will also be even. And so what I'll do next is look at what values of $A$ we generate for different values of $\sqrt{A}$ with different $m$:

$\left(\begin{matrix}A & n & \sqrt{A} & m \\ 4 & 1 & 2 & 1 \\ 16 & 2 & 4 & 1 \\ \vdots & \vdots & \vdots & \vdots \\ 64 & 2 & 8 & 1 \\ 100 & 3 & 10 & 2 \\ \vdots & \vdots & \vdots & \vdots \\ 900 & 3 & 30 & 2 \\ 1024 & 4 & 32 & 2 \\ \vdots & \vdots & \vdots & \vdots \\ 9604 & 4 & 98 & 2 \\ 10000 & 5 & 100 & 3\end{matrix}\right)$

And so we can see relationships:

$n = 1 , m = 1$
$n = 2 , m = 1$
$n = 3 , m = 2$
$n = 4 , m = 2$
$n = 5 , m = 3$

and so on.

And so we can calculate $m$ for any $n$, where,

• if $n$ is even, $m = \frac{n}{2}$
• if $n$ is odd, $m = \frac{n + 1}{2}$

Let's test it out:. Let's say sqrtA=45678, m=5=>A=2086479684, n=10 color(green)sqrt