|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Fibonacci Sequence
I used Java. I used the BigInteger class. Otherwise I would have roundoff errors as you said.
|
|
#2
|
|||
|
|||
|
Re: Fibonacci Sequence
Ah, yes, Java. I should learn that sometime... after I finish learning C++ and learn Python. Maybe if I hook myself up with the AP CS exam next year, I'll be motivated enough to learn Java (our school doesn't offer AP CS, but I was able to take AP English without the class this year, so I don't see a difference there).
What kind of hardware do you have on the computer you did that on? Oh, just FYI, I think the computer I did this on originally has 256 MB RAM and less than a 1 GHz processor... not fun... |
|
#3
|
|||
|
|||
|
Re: Fibonacci Sequence
I'm on a Lenovo laptop right not. T40. 1 GB RAM, 1.59 GHz processor. So its not the latest and greatest, but at the same time it works well, and faster than your machine. My home desktop is better. I'm going to run it on that and see what happens. For kicks I'd see how high I can get. I got to the 10,000,000th term in about 37 minutes, and I'm guessing it would take around 50 hours to get to 100,000,000 if the pattern continues.
|
|
#4
|
|||
|
|||
|
Re: Fibonacci Sequence
Try the 100 000 000 and post the results... THAT would take a lot of text documents.
|
|
#5
|
|||
|
|||
|
Re: Fibonacci Sequence
I'll try to. I think I found a way to make my program significantly faster. With a new algorithm and my desktop computer it took ~9 sec to get the millionth term and 3:22:000 for the 5,000,000th. I'll try 100 mil. My guess is about 15-20 hour run time.
|
|
#6
|
||||
|
||||
|
Re: Fibonacci Sequence
Quote:
![]() |
|
#7
|
|||
|
|||
|
Re: Fibonacci Sequence
I tried that, but it didn't work for me, with such large numbers. Feel free to see if you can get it to work yourself.
|
|
#8
|
|||
|
|||
|
Re: Fibonacci Sequence
Would you care to share this new algorithm? I'm interested to see it.
|
|
#9
|
||||
|
||||
|
Re: Fibonacci Sequence
I found a mathimatical function to define it, thus eliminating recursion. Have fun...
Code:
((x^n)-(-x)^(-n))/sqrt(5) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mechanics of a 3 speed shifting sequence | sanddrag | Technical Discussion | 3 | 27-02-2005 00:34 |
| [FVG]: Opening Sequence | Joshua May | FIRST-related Organizations | 16 | 24-06-2004 00:00 |
| RC bootup sequence | Venkatesh | Programming | 17 | 18-11-2003 20:56 |
| PB_Mode Sequence | DKolberg | Programming | 3 | 17-03-2003 10:54 |
| Competition Sequence for PBasic | ttedrow | Programming | 12 | 23-01-2003 08:49 |