# General Formula for a sequence with indices increasing in the order \$(2 * i)\$, where i = 0,1,2,3...

by Samrat Mukherjee   Last Updated September 12, 2019 04:20 AM

I have generated a sequence which looks really simple : $$f(n) = 0, 1, 1, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 15 ....n$$

The indices are having the same values in the order of $$(2*i)$$ where $$i = 0,1,2,3...$$

Thank you

Tags :

So the formula could be $$f(n)=2^{\lfloor\log_2(n)\rfloor}-1$$ where $$\lfloor x\rfloor$$ means the largest integer no more than x.