Find closed sequences of $y= \lceil log_2 x\rceil$ function

54 Views Asked by At

Question regarding the ceiling of a binary logaritm and it's sequences.

How to calculate the sequences of the closed form: $y= \lceil log_2 x\rceil$ where $x\in\mathbb{N} ?$

Description

I want to calculate the sequence (every $x$) from any arbitrary $y$. I was thinking maybe finding $x$ would be impossible because of ceiling removing the decimal part, but after some study I think otherwise.

\begin{array}{|c|c|c|c|} \hline x&log_2x&\lceil log_2x\rceil\\ \hline 1 &0&0\\ \hline 2 &1&1\\ \hline 3 &1.58...&2\\ \hline 4 &2&2\\ \hline 5 &2.32...&3\\ \hline .. &...&...\\ \hline \end{array}

For

  • $y=2$, that is when $2 = log_2 x$ there are two elements (3,4) in the sequence. So $x$ can be 3 or 4.
  • $y=3$, that is when $3 = log_2 x$ there are four elements (5,6,7,8) in that sequence, and so on...

So for $y=2$ and $y=3$ the sequences are finite. We would know the number of elements by $2^{y-1}$ if I am not mistaken. So by that we can compute every element in the sequence of an arbitrary $y$?

Infinite or finite?

A question that is not particular relevant to my original post, but would be kinda fun to know: When $y=\infty$ the number of elements is $2^{\infty-1}$. Does it mean that $x$ is infinite and the number of elements in the $\lceil log_2 x\rceil$-sequence are infinite too?

1

There are 1 best solutions below

0
On BEST ANSWER

If I understand your question, for a given integer $y$, you want the set of integers $x$ such that $$ \left\lceil \frac{\log x}{\log 2} \right\rceil = y. $$ This equation is true exactly when $$ y-1 < \frac{\log x}{\log 2} \le y $$ which yields $$ 2^{y-1} < x \le 2^y $$ so your set of $x$ values is $\{2^{y-1}+1,2^{y-1}+2,\dots,2^y\}$.