What is the formula for calculating the number of bits required to encode the number $x$ in Fibonacci coding?

97 Views Asked by At

What is the formula for calculating the number of bits required to encode the number $x$ in Fibonacci coding?

For example:
if $x=1$ then because $1$ in Fibonacci coding is "11" therefore the formula will return $2$,
if $x=2$ then because $2$ in Fobonacci coding is "011" therefore the formula will return $3$,
if $x=10$ then because $10$ in Fibonacci coding is "010011" therefore The formula will return $6$.

Updae:

Thanks to lulu for the link A130233 which contains some versions of formulas that satisfy the solution. The simplest version of them: $a\left(n\right)=\left\lfloor\frac{\log_{10}{\left(\sqrt5\cdot n+1.5\right)}}{\log_{10}{\frac{\sqrt5+1}{2}}}\right\rfloor$