Let n be a positive integer. We note that n = 2^{\log _2 n}, so our goal is equivalently to find some l:\mathbb {N} such that 2^l\leq 2^{\log _2n}<2^{l+1}. Because the exponential function is strictly increasing, it suffices to find some l:\mathbb {N} such that l\leq \log _2n <{l+1}.
To that end, we consider l\coloneqq \lfloor \log _2n\rfloor , i.e. the floor of \log _2n. Clearly we have \lfloor \log _2n\rfloor \leq \log _2n; to check that \log _2 n < \lfloor \log _2n\rfloor +1, we note that the difference \log _2n - \lfloor \log _2n\rfloor must be strictly smaller than 1.