Page 1 of 3

Big Fib

Posted: Sun Nov 02, 2008 1:01 am
by rmplpmpl
Ok, another problem I have - I want to believe I got the correct number and the answer but it is not accepted.

Anyway, could please someone tell me if the number I have is correct, starting with 11742003035506558... and ending with ...32895630172796932853738956168354898000000

the six zeros at the end tell me that I might have a glitch in my computation...

Re: Big Fib

Posted: Sun Nov 02, 2008 2:05 am
by MerickOWA
rmplpmpl wrote:Ok, another problem I have - I want to believe I got the correct number and the answer but it is not accepted.

Anyway, could please someone tell me if the number I have is correct, starting with 11742003035506558... and ending with ...32895630172796932853738956168354898000000

the six zeros at the end tell me that I might have a glitch in my computation...
Can't be a prime and end in zeros ;) It would trivially be divisible by 2 or 5 ;)

Re: Big Fib

Posted: Sun Nov 02, 2008 2:28 am
by the_impaler
[quote="MerickOWA"]

Can't be a prime and end in zeros ;) It would trivially be divisible by 2 or 5 ;)[/quote]
How do you know that it "can't be a prime" ? 13 is prime and so is 233 and there are more.
Of course you know because you have found it but off the bat it's hard to say.
That would probably give adum another crazy number crunching idea like "find the prime fib that has last 100 digits matching pi in reverse"

Posted: Sun Nov 02, 2008 6:50 am
by sigi
I have no idea what Merick is talking about... anyway: you're supposed to give every 20,000th digit of the 1.5 millionth Fibonacci number -- and your answer is having a string of zeroes at the end. I would like to say that it's extremely unlikely that you answer is correct.

I'm not a number theorist but I'm guessing that the answer to this challenge pretty much amounts to a random number -- meaning that every digit is roughly equally likely.

There's not that much that can go wrong with this challenge (or the coding involved). Just re-check your code.

Posted: Sun Nov 02, 2008 10:53 am
by rmplpmpl
sigi wrote:I have no idea what Merick is talking about... anyway: you're supposed to give every 20,000th digit of the 1.5 millionth Fibonacci number -- and your answer is having a string of zeroes at the end. I would like to say that it's extremely unlikely that you answer is correct.

I'm not a number theorist but I'm guessing that the answer to this challenge pretty much amounts to a random number -- meaning that every digit is roughly equally likely.

There's not that much that can go wrong with this challenge (or the coding involved). Just re-check your code.
Yupp, I know that 20,000th digit part and I could extract THAT part easily, but since I obviously got the wrong number, the resulting digits were wrong, too. Bah, back to computation.


Thumbs up to these challenges who make me learning stuff!

Posted: Sun Nov 02, 2008 11:34 am
by gfoot
I just recalculated it - I get the same ending as you, but a different beginning. Maybe you calculated the 1499999th instead. :)

Re: Big Fib

Posted: Mon Nov 03, 2008 5:58 am
by MerickOWA
the_impaler wrote:How do you know that it "can't be a prime" ? 13 is prime and so is 233 and there are more.
Of course you know because you have found it but off the bat it's hard to say.
That would probably give adum another crazy number crunching idea like "find the prime fib that has last 100 digits matching pi in reverse"
It can't be prime if the last digit is a zero. Any number that ends in zero is divisible by 10, and thus NOT prime.

Same way I can trivially prove that every prime (except 2 and 5) must end with either 1, 3, 7 or 9. If it ended in 0,2,4,6,8 it would be even and thus divisible by 2. If it ends in 0 or 5 its divisible by 5.

Posted: Mon Nov 03, 2008 6:02 am
by MerickOWA
Ok ignore me, I was thinking of a different problem were you have to calculate a big prime number ;) fibonacci numbers are different sorry ;)

Posted: Mon Nov 03, 2008 8:23 am
by eike42
I have the same value... either its correct, or we're using the same codebase:

Used this one: http://www.bigzaphod.org/fibonacci/

My own perl script was too damn slow and I was to lazy to write C code ;)

Posted: Mon Nov 03, 2008 10:43 am
by rmplpmpl
eike42 wrote:I have the same value... either its correct, or we're using the same codebase:

Used this one: http://www.bigzaphod.org/fibonacci/

My own perl script was too damn slow and I was to lazy to write C code ;)
hm, I used another tool (Formula One IDE) for computation of the number and a generic tool to extract the digits asked for. Length of "my" number is 67170, so the solution had four digits.

Posted: Mon Nov 03, 2008 12:14 pm
by snibril
fib(1500000) can be computed in under 5min on a Phenom 9850 with bc under linux and has more than 300000 digits.

Posted: Wed Nov 05, 2008 2:51 pm
by hoki
I'm kinda stuck here. First I computed what I thought was the right number using bc. Then I noticed it asked for the 1,500,000th member of the Fibonacci sequence instead of fib(1.5m), so I recalculated. Still my solutions don't seem to be correct.

My number starts with "19768781" and ends with "345698". It has 313481 digits.

Did I get it right that you want the first digit, then take a 20,000-step, that digit (20001th) and so on? Or do you want the first and the k*20,0000th digits, with k = 1,2,...

Bye,
hoki

Posted: Wed Nov 05, 2008 3:00 pm
by snibril
It starts with 129... and ends with ...000

Posted: Thu Dec 04, 2008 6:29 pm
by brazzy
I think one reason why many people are having problems is that some definitions of the Fibonacci sequence have it start with 0 and 1, and others start with 1 and 1, so that the numbering is one off between those two definitions.

Fib 1 = 1

Posted: Fri Dec 05, 2008 7:57 pm
by abc
Hi!
I think everybody should know that the first fib=1 in this challenge. (not 0)
Still got the same problems...

abc