hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Big Fib
Goto page Previous  1, 2, 3  Next
 
Reply to topic    hacker.org Forum Index » Challenges View previous topic
View next topic
Big Fib
Author Message
Chocoholic



Joined: 16 Feb 2009
Posts: 44
Location: UK

Post Reply with quote
abc: I don't quite get what you want to say.

Anyways, you might want to notice that the text reads "the 1500000th member" of the sequence, not F(1500000). There's a difference, and I calculated 3 different numbers until I got the right one.
Sat Feb 21, 2009 12:15 am View user's profile Send private message ICQ Number
quwieorp



Joined: 07 Apr 2009
Posts: 2

Post Reply with quote
So how is the Fibonacci sequence defined in this challenge?
Like this?:
Fib(0) = 0
Fib(1) = 1
Fib(2) = 1
Fib(3) = 2
Fib(1 500 000) <--
Thu Apr 09, 2009 12:34 pm View user's profile Send private message
lukas



Joined: 26 Nov 2008
Posts: 34
Location: Germany

Post Reply with quote
If he is right:

snibril wrote:
It starts with 129... and ends with ...000


Then you have to take the "1500001" if you count like that:

"Fib(0) = 0
Fib(1) = 1
Fib(2) = 1
Fib(3) = 2"

I have this number, but still don't get the answer. Something on my every 20.000 function must be wrong Sad
Thu Apr 09, 2009 1:52 pm View user's profile Send private message
tschiew



Joined: 05 Mar 2009
Posts: 11

Post Reply with quote
Quote:
So how is the Fibonacci sequence defined in this challenge?
Like this?:
Fib(0) = 0
Fib(1) = 1
Fib(2) = 1
Fib(3) = 2
Fib(1 500 000)


No, the sequence is defined as follows:
Fib(0) = 0
Fib(1) = 1
Fib(2) = 2
...

I also got this problems....
Tue Apr 14, 2009 5:27 pm View user's profile Send private message
cutter



Joined: 12 Jan 2009
Posts: 17

Post Reply with quote
looks like the sequence of the natural numbers Wink
Tue Apr 14, 2009 5:49 pm View user's profile Send private message
wiz1989



Joined: 19 Feb 2009
Posts: 10
Location: Germany

Post Reply with quote
It's

Fib(0) = 1
Fib(1) = 1
Fib(2) = 2
Fib(3) = 3

Just to be correct Wink
Tue Apr 14, 2009 8:49 pm View user's profile Send private message
teebee



Joined: 10 Nov 2008
Posts: 89
Location: Germany

Post Reply with quote
looks like the sequence of the natural numbers with one exception Wink
Tue Apr 14, 2009 9:01 pm View user's profile Send private message
blablaSTX



Joined: 17 Aug 2009
Posts: 11

Post Reply with quote
there is no need for it be prime, so please do not discard your result simply because it ends in zeros.

Code:

(1 to:20) collect:[:n | n fib]

gives:
#(1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765)
of which 8, 21, 34, 55 ... are NOT prime.
And, as you can see, "fib 15" also gives you a number which ends in a zero.
Tue Aug 25, 2009 1:03 pm View user's profile Send private message Visit poster's website
quangntenemy



Joined: 02 Jul 2009
Posts: 8

Post Reply with quote
Do you guys calculate it the traditional way? It's kinda slow for me.
Sun Aug 30, 2009 5:08 am View user's profile Send private message
blablaSTX



Joined: 17 Aug 2009
Posts: 11

Post Reply with quote
... "in the traditional way" ...

Almost; two little tricks help with big numbers, though (both a math trick and a coding trick).
That should not reveal too much info, I hope.
Mon Aug 31, 2009 6:23 pm View user's profile Send private message Visit poster's website
whattheh@ck



Joined: 16 Jul 2008
Posts: 16
Location: here

Post Reply with quote
I was able to do it in about 10 minutes using Python... It's very good at handling large integers. The answer is 16 digits long so the actual number has to be over 320,000 digits long.

_________________
hack the planet
Sun Nov 08, 2009 1:24 am View user's profile Send private message
CodeX



Joined: 17 Oct 2008
Posts: 350

Post Reply with quote
it took me less than a second to calculate with a high precision calculator and Binet's formula Very Happy
Sun Nov 08, 2009 1:43 pm View user's profile Send private message
Guderian



Joined: 25 Jan 2011
Posts: 18
Location: Greece

Post Reply with quote
i solved with the recursive way and c++. I used to huge char arrays of 1 million bytes each to store the results. It took 5 hours to get the result. However the tricky part is the next challenge, must find a way to calculate the ln of this array Razz
Sun Jan 30, 2011 1:55 pm View user's profile Send private message
Millennium



Joined: 21 Apr 2011
Posts: 17

Post A Word to the Wise Reply with quote
It's not the 1st digit, followed by the 20,000th digit, etc. or the 20,000th followed by the 40,000th, but rather the 1st followed by the 20,001st. That's what originally got me XD
Sun May 15, 2011 7:07 pm View user's profile Send private message
compudemon



Joined: 13 Aug 2011
Posts: 33

Post Reply with quote
lucky for me i got it on the first try, it does not help that the web does not agree weather it is

1,1,2,3,5
0,1,1,2,3,5

or if the first in the sequence would be 0 or 1

so here is a hint

55 is the 10th number in the fib series given by the same code i solved it with

i used python i would say it was solved in less then 5 mins, i left when it wasn't an instant answer
Thu Aug 18, 2011 7:11 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    hacker.org Forum Index » Challenges All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.