# Thread: Fibonacci and decimal representation bounds

1. No, I was reffering to the GMP, but yes, I can say for sure that this is a buggy code of mine. Couldn't get a really good approach and the last thing I tried was something like this:
Code:
```double test_dig(double a) {// LOG (Phi^1000/√5)
double phi = 1.618033;
double sqrt_5 = 2.2360679775;
//return (a*phi - (0.34948500216));
std::cout << pow(phi, a) << std::endl;
return log10(pow(phi, a)/sqrt_5);
}

int main() {
double aa = 1000;

std::cout << "1 = " << test_dig(aa) << std::endl;
std::cout <<"2 = " << test_dig(2) << std::endl;
std::cout <<"3 = " << test_dig(3) << std::endl;
std::cout <<"5 = " << test_dig(5) << std::endl;
std::cout <<"8 = " << test_dig(8) << std::endl;
std::cout <<"13 = " << test_dig(13) << std::endl;
aa = 21;
std::cout << aa << " = " << test_dig(aa) << std::endl;
aa = 34;
return 0;
}```
However, I did face the same fact as anduril:
""Tuning" it to be more accurate would be fun if I had the time, but probably also goes beyond my current math skills (which have degraded significantly since I finished school)."

2. Well, the Fibonacci sequence grows polynomially (specifically, quadratically), therefore the number of digits is going to be proportional to log(k). I am too lazy to put tighter bounds than that...

3. Originally Posted by brewbuck
Well, the Fibonacci sequence grows polynomially (specifically, quadratically), therefore the number of digits is going to be proportional to log(k). I am too lazy to put tighter bounds than that...
The link of Epy provides a better-ready one, based on this thought and mine (the relation with phi)

4. Originally Posted by brewbuck
Well, the Fibonacci sequence grows polynomially (specifically, quadratically), therefore the number of digits is going to be proportional to log(k). I am too lazy to put tighter bounds than that...
It grows exponentially and so the digits are proportional to k.

5. It grows exponentially and so the digits are proportional to k.
O_o

The growth "trends" but is never constant.

The secondary "term"--not mathematics guy--is a constant `log(φ)'.

The tertiary "term" is also a constant `log(5)/2'.

As it grows, the measure is more "geometric" with "n".

Soma

6. Originally Posted by Epy
It grows exponentially and so the digits are proportional to k.
You're right. That wrong piece of information has been in my head for a very long time...

7. O_o

So this latest post shows up and I spend ten minutes trying to figure out how the it could have actual exponential growth.

*derp*

I got muddled up in thinking about `floor(log10(fib(n)))'.

Soma