bigger fib

aurora
Posts: 54
Joined: Thu Feb 05, 2009 12:31 pm
Location: Bavaria, Germany

bigger fib

Post by aurora »

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,
MagneticMonopole
Posts: 26
Joined: Fri Nov 07, 2008 3:19 pm

Post by MagneticMonopole »

Suggest you stop it.
Read the challenge again. It does not ask for the fibonacci number itself. :wink:
megabreit
Posts: 141
Joined: Sat Jan 03, 2009 3:33 pm

Post by megabreit »

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... :lol:
User avatar
teebee
Posts: 89
Joined: Mon Nov 10, 2008 3:21 pm
Location: Germany

Post by teebee »

Hm... I computed the fibonacci number within 9 minutes on a 600MHz CPU. The logarithm was computed within 1.5 seconds. Obviously, I had the right touch with the choice of my tools.
aurora
Posts: 54
Joined: Thu Feb 05, 2009 12:31 pm
Location: Bavaria, Germany

Post by aurora »

thanks for the hints. i searched a little longer and found a better tool for calculating the fib. it took a very short time now. but now the problem is the log. there must really be some math trick, to solve it -- but i could not figure out how it works, yet :) ...
cyberwoozle
Posts: 60
Joined: Fri Nov 07, 2008 10:43 am
Location: Germany

Post by cyberwoozle »

It's only math - you don't need any other tool than the Windows calculator.
megabreit
Posts: 141
Joined: Sat Jan 03, 2009 3:33 pm

Post by megabreit »

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" :lol:
User avatar
teebee
Posts: 89
Joined: Mon Nov 10, 2008 3:21 pm
Location: Germany

Post by teebee »

megabreit wrote:There is a second motivation: You surely won't brute-force the following challenge "Biggest Fib" :lol:
You are definitely right. There my tools would fail too - I did not even try to solve "Biggest Fib" using them.
User avatar
m!nus
Posts: 202
Joined: Sat Jul 28, 2007 6:49 pm
Location: Germany

Post by m!nus »

*snip* seems to be a bad habit of mine to post solutions...
Last edited by m!nus on Sun Feb 22, 2009 6:12 pm, edited 1 time in total.
cyberwoozle
Posts: 60
Joined: Fri Nov 07, 2008 10:43 am
Location: Germany

Post by cyberwoozle »

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 .
DaymItzJack
Posts: 106
Joined: Thu Oct 29, 2009 9:21 pm

Post by DaymItzJack »

Can someone who has completely this message me? I think my method should be correct but I am getting the wrong answers and it's driving me crazy.
crstnbr
Posts: 3
Joined: Tue Nov 24, 2009 6:17 pm

Post by crstnbr »

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
User avatar
CodeX
Posts: 350
Joined: Fri Oct 17, 2008 5:28 pm

Post by CodeX »

It sounds like your looking for a closed expression way of calculating numbers in the Fibonacci sequence... maybe looking at the Wikipedia article would help :P
tripleedged
Posts: 10
Joined: Fri Apr 16, 2010 11:24 pm

Post by tripleedged »

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...
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post by AMindForeverVoyaging »

CodeX wrote:It sounds like your looking for a closed expression way of calculating numbers in the Fibonacci sequence...
Sounds like a good idea. So the formula is:

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.
Post Reply