In the sequence $\ x_1=\lfloor\frac{2^n}n\rfloor$ and $x_{i+1}=x_i-\lfloor\frac{2^{n-i}}{n-i}\rfloor\text{sgn}(x_i)$ is $x_{n-1}\in\{-1,0,1\}$?

41 Views Asked by At

I've been fiddling with numbers and have made an interesting observation on the sequence defined by $a_0=1$ and $a_n = \lfloor\frac{2^n}n\rfloor, \ \forall n\in\mathbb{N}$.

For a real sequence $a_0,a_1,\ldots$ and some element $a_n$, we can associate a sequence ${({b(n)}_m)}_{m\in\{0,\ldots,n\}}$ (which I'll be referring to as ${(b_m)}_{m\in\{0,\ldots,n\}}$ ) defined as follows :

  • $b_0 = a_n$
  • $b_{i+1}=\begin{cases}b_i - a_{n-i-1} & \mbox{if} & b_i > 0\\b_i +a_{n-i-1} & \mbox{if} & b_i<0 \\0 & \mbox{if} & b_i = 0 \end{cases}$

I'm conjecturing that if we have the sequence $a_0=1$ and $a_n = \lfloor\frac{2^n}n\rfloor\ \forall n\in\mathbb{N}$, then $b_n =0\ \forall n\geq2$.

I've verified this result for up to $n=10^5$ and was wondering why this seems to hold.

1

There are 1 best solutions below

2
On BEST ANSWER

Your $(a_n)$ sequence has a few propierties that are nice for your statement: It starts with low values ($1,2,2,2,4,6\ldots$), is non-decreasing, but also not increasing too fast: $\forall n \ge 0: a_{n+1} \le 2a_n$. The latter follows "by inspection" for $n < 5$ and for $n \ge 5$ from

$$2a_n \ge 2\times(\frac{2^n}n-1) = \frac{2^{n+1}}n -2 = \frac{2^{n+1}}{n+1}\frac{n+1}n -2 = \frac{2^{n+1}}{n+1} + \frac{2^{n+1}}{n(n+1)} -2 \ge \frac{2^{n+1}}{n+1} \ge a_{n+1},$$

because $\frac{2^{n+1}}{n(n+1)} \ge 2$ starting at $n=5$ (which can be proven easily by induction).

I'll generalize your problem by considering any integer starting value $b_0=z$, and I'll denote as $b_{i,n}(z)$ the $i$-th element of your sequence, when the starting value is $z$. The value of $n$ I'll call the "length" of the sequence, as we stop at $b_{n,n}(z)$

Your conjecture is that for $n \ge 2$, $b_{n,n}(a_n)=0$, while I'll prove that more generally $b_{n,n}(z) = 0 $ for all integer $z$ with $|z| \le a_n$.

A few key observations:

$$\forall n,i\ge 0, z\in \mathbb Z: b_{i+1,n+1} (z)= b_{i,n}(b_{1,n+1}(z)). \tag{1} \label {eq1}$$

Once you have generated your first element $b_{1,n+1}(z)$ from $z$ for a sequence of length $n+1$, the remainder of your algorithm is just the same as if you were starting with $b_{1,n+1}(z)$ and generate from it a sequence of length $n$. Since both $i$ and $n$ are shifted by one, the term $a_{n-i-1}$ used in your reursion is the same in each step $\blacksquare$.

$$\forall n,i\ge 0, z\in \mathbb Z: b_{i,n} (-z)= -b_{i,n}(z). \tag{2} \label {eq2}$$

It's true for $i=0$ and follows easily by induction over $i$ from your recursion $\blacksquare$.

So now the proof by induction that I promised above:

$$\text{For $n \ge 2$, $b_{n,n}(z) = 0 $ for all integer $z$ with $|z| \le a_n$.} \tag{*} \label{claim}$$

Generally, we need to do actual work only for the $0 \le z \le a_n$, as for negative $z$ it follows via $\eqref{eq2}$.

The base case is $n=2$, and we need to consider starting values $0,1$ and $2$, as $a_2=2$. Those 2 length sequences are easily seen to be $0,0,0; \; 1,-1,0;$ and $2,0,0$, resp., and they all end in $0$, as claimed.

Induktion step:

Induction hypethesis: Assume \eqref{claim} is true for $n=k$.

Consider any $z\in \mathbb Z$ with $0 \le z \le a_{k+1}$. By the recursion formula we have

$$b_{1,k+1}(z)=z-a_{k+1-0-1}=z-a_{k}.$$

But now we see that $-a_{k} \le z -a_k \le a_{k+1} - a_{k} \le a_k$, the latter inequality following from $a_{k+1} \le 2a_k$ mentioned above. This means, we can apply the induction hypothesis to $z-a_k$ and we get

$$b_{k,k}(z-a_k)=0.$$

But due to \eqref{eq1} we have $b_{k+1,k+1}(z) = b_{k,k}(z-a_k)$, so we get $b_{k+1,k+1}(z)=0$ as claimed. For negative $z$ with $|z| \le a_{k+1}$, the result follows again by \eqref{eq2}. So we have proved the induction hypothesis is true for $n=k+1$, which concludes the prove by induction $\blacksquare$.

As can be seen, the only required property was $a_{n+1} \le 2a_n$ and that the base case works, which I think boils down to $a_0=1$.

For any starting value $0 \le z \le a_n$, the corresponding sequence $b_{i,n}(z)$ "moves towards zero", then "oscillates" around zero and at some time at or before index $i=n$ reaches it. The $a_{n+1} \le 2a_n$ condition makes sure that $b_{i,n}(z)$ goes down fast enough to actually reach or overshoot into the negatives before $i=n$.