bigger fib
bigger fib
hello,
would just like to ask, if actually someone calculated the bigger fib -- the 150000000th member of the fibonacci sequence? gnu bc is running 30 hours now. would like to know, if it's better to stop or if i have to wait some more days to get a result from it
thanks,
would just like to ask, if actually someone calculated the bigger fib -- the 150000000th member of the fibonacci sequence? gnu bc is running 30 hours now. would like to know, if it's better to stop or if i have to wait some more days to get a result from it
thanks,
-
- Posts: 26
- Joined: Fri Nov 07, 2008 3:19 pm
Hm... I thought there has to be some math trick. But I was to lazy to search.
I found a quite fast algorithm that calculated the number in about a week... bc is substantially slower in comarision!
Now I'm waiting for the calculation of the logarithm. Hopefully it does not take longer than the fib calculation.
If I had known that it takes that long, I'd searched longer for an alternate algorithm...
On the other hand: The server is there and has (mostly) nothing else to do so why don't let it calculate things...
I found a quite fast algorithm that calculated the number in about a week... bc is substantially slower in comarision!
Now I'm waiting for the calculation of the logarithm. Hopefully it does not take longer than the fib calculation.
If I had known that it takes that long, I'd searched longer for an alternate algorithm...
On the other hand: The server is there and has (mostly) nothing else to do so why don't let it calculate things...
-
- Posts: 60
- Joined: Fri Nov 07, 2008 10:43 am
- Location: Germany
I'm sorry if I motivated somebody to calculate fib and the logarithm manually... at least if you don't have teebee's tools. I did not have them, and stopped calculations after 2 weeks on a dedicated server. Being lazy is not very efficient with this challenge.
After 20 min Google and remembering some school math it was no problem calculating the result.
There is a second motivation: You surely won't brute-force the following challenge "Biggest Fib"
After 20 min Google and remembering some school math it was no problem calculating the result.
There is a second motivation: You surely won't brute-force the following challenge "Biggest Fib"
-
- Posts: 60
- Joined: Fri Nov 07, 2008 10:43 am
- Location: Germany
Ehemmm......., i would delete the last one from the forum, 'cuz this is the solution - with a slight modification it prints the solution. If it doesn't work on your PC, it's only possible, that you made a mistake in copying and pasting it to the answer field.
I had to modify your solution for python, not becasue there's a mistake in it .
I had to modify your solution for python, not becasue there's a mistake in it .
-
- Posts: 106
- Joined: Thu Oct 29, 2009 9:21 pm
Can anybody give me a hint for the "Biggest Fib" Challenge. I could calculate the Bigger Fib but, 150000000000000 is too huge i googled for something like a exponential approximation of the fibbonacci numbers. i hoped to find a way to use some log and exp transformation rules to make the challenge easier to solve, but i had no success so far. So a hint would be nice. Maybe someone could tell me if i'm on the right track with the mathematic research.
thanks
crstnbr
thanks
crstnbr
-
- Posts: 10
- Joined: Fri Apr 16, 2010 11:24 pm
I got stuck on this, too... (Bigger Fib)
I think I have done the right calculation, but it tell me I'm false.
Does the correct number have the same two digits at the beginning and right before the decimal point?
(like 72xxxxxxxx72.xxxxx)
Don't want to spoil something, but I may have a problem with rounded numbers. The error might get quite large...
I think I have done the right calculation, but it tell me I'm false.
Does the correct number have the same two digits at the beginning and right before the decimal point?
(like 72xxxxxxxx72.xxxxx)
Don't want to spoil something, but I may have a problem with rounded numbers. The error might get quite large...
-
- Forum Admin
- Posts: 496
- Joined: Sat May 28, 2011 9:14 am
- Location: Germany
Sounds like a good idea. So the formula is:CodeX wrote:It sounds like your looking for a closed expression way of calculating numbers in the Fibonacci sequence...
Fn = (phi ^ n - psi ^ n )/ sqrt(5), where phi = (1+sqrt(5))/2 and psi = (1-sqrt(5))/2
Now to rewrite the equation:
Fn * sqrt(5) = phi ^ n - psi ^ n
log (Fn * sqrt(5)) = log(phi ^ n - psi ^ n)
log Fn + 1/2 log 5 = log(phi ^ n - psi ^ n)
My problem here is that there is no algebraic formula for the logarithm of a difference
I seem to be unable to get the pesky n away from the exponent, and that is exactly what you want to do if you don't want to multiply 150000000 times, is it not? Or am I missing something here? Any hint would be appreciated.