0
$\begingroup$

The general problem is this. I try to find a positive integer $\delta_n$ such $qv_n^2 +\delta_n = p\cdot 4^n$. More precisely, I am looking for a lower bound (depending on $n$) for $\delta_n$ as $n\rightarrow\infty$. Here $v_n$ is the largest positive odd integer such that $qv_n^2 \leq p\cdot 4^n$, given $n$. In short, $\delta_n = p \cdot 4^n - qv_n^2\geq 0$ is the approximation error. For simplicity, focus on $q=2, p=1$. More generally, $0 < p/q < 1$ is not the square of a rational number.

Background

Assume $q=2, p=1$. I expect $\delta_n$ to possibly be something like $O(2^n/\log_2 n)$. So far (I just started) all I have is $\delta_n > 0$. This trivial bound actually leads to a remarkable result: the longest run of zeros in in the binary digits of $\sqrt{p/q}$, starting at position $n+1$ assuming the digit in position $n$ is equal to 1 and $n$ is large enough, can not be longer than $n + C$ where $C$ does not depend on $n$.

The general result, explaining my interest in the problem and why I have a good idea (but no proof) about the asymptotics of $\delta_n$, is the following (the result below is proved and verified empirically):

If the binary digit of $\sqrt{p/q}$ at position $n$ is equal to $1$, then it is followed by a run of exactly $R_n$ digits all equal to zero (with $R_n=0$ in case the next digit is also $1$), with

$$R_n = \Big\lfloor n+1 +\frac{1}{2}\log_2(pq) - \log_2 \delta_n \Big\rfloor.$$

It is an exact formula, not an asymptotic relationship or approximation.

$\endgroup$
4
  • $\begingroup$ The largest such integer is obviously $\lfloor \sqrt{4^n/2}\rfloor$, so the largest odd one will be either than or one less than it, depending on parity. Am I missing something? $\endgroup$
    – Wojowu
    Commented May 28, 2023 at 17:35
  • $\begingroup$ That does not lead to any progress with the main issue. I expect the largest runs $R_n$ to be $O(\log n)$, probably a very hard problem. All I have now is $n + O(1)$. Anything better, say $O(n^{3/4})$ would be a substantial improvement and probably a new result. Even $n +O(1)$ might already be a new result, albeit relying on trivialities in the end. $\endgroup$ Commented May 28, 2023 at 17:45
  • $\begingroup$ I changed the title to better reflect my interest in the problem. $\endgroup$ Commented May 28, 2023 at 17:54
  • $\begingroup$ The problem can be solved exact. The condition $v_{n}$ odd has to be taken into account with 2 k -1. So $k=\frac{2+/-\sqrt{2^n+1}}{4}$ for + round down for - round up. The sequence diverges. Depending on You use round, floor etc. the is a maximum value for n so that the the difference changes sign. For - and round this is n=54. $\endgroup$ Commented May 28, 2023 at 19:58

0

You must log in to answer this question.