Rounded Square Roots

Problem Statement

We define the rounded-square-root of a positive integer $n$ as the square root of $n$ rounded to the nearest integer.

The following procedure (essentially Heron's method adapted to integer arithmetic) finds the rounded-square-root of $n$:

Let $d$ be the number of digits of the number $n$.
If $d$ is odd, set $x_0 = 2 \times 10^{(d-1)/2}$.
If $d$ is even, set $x_0 = 7 \times 10^{(d-2)/2}$.
Repeat:

$$x_{k+1} = \Biggl\lfloor{\dfrac{x_k + \lceil{n / x_k}\rceil}{2}}\Biggr\rfloor$$

until $x_{k+1} = x_k$.

Using this procedure, what is the average number of iterations required to find the rounded-square-root of a $N$-digit number ($10^{N - 1} \le n \lt 10^{N}$)?
Give your answer rounded to $10$ decimal places.

Submit Answers

You need to submit in the format: "N:problem(N)", possibly with multiple values at once, separated by commas, with $N$ between $1$ and $100$.

Top Users

🥇 icy
20.80 (21)
🥈 shs10978
20.80 (21)
🥉 mmtg
3.20 (4)

Data

Stats

Your submissions will appear here

Recent Submissions

1
mmtg
$g(4)$, $12$ digits 1 week ago
2
mmtg
$g(4)$, $12$ digits 1 week, 1 day ago
3
mmtg
$g(4)$, $12$ digits 1 week, 1 day ago
4
mmtg
$g(3)$, $12$ digits 1 week, 1 day ago
5
mmtg
$g(2)$, $12$ digits 1 week, 1 day ago