What is the length 1 5 th Prime number found in the Fibonacci Sequence?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Trial division is not the best prime test especially if the numbers are very large. I used Miller-Rabin primality test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
Output -
1 |
|
Length is 75.
The prime test doesn't always provide correct results but the chances of algorithm being wrong are almost negligible.
Because we know that a ∣ b \Rightarow f a ∣ f b , we can restrict our attention to prime indices.
How can we deal with such huge numbers of 75 digits or even more in C++? Even long long int typed variable over flows....
Log in to reply
Log in to reply
Hmmm... I wasn't aware of the library it will be very helpful to me. Thanks.
Check this out
The 15th Prime number in Fibonacci is
4 7 5 4 2 0 4 3 7 7 3 4 6 9 8 2 2 0 7 4 7 3 6 8 0 2 7 1 6 6 7 4 9 3 8 2 9 2 7 7 0 1 4 1 7 0 1 6 5 5 7 1 9 3 6 6 2 2 6 8 7 1 6 3 7 6 9 3 5 4 7 6 2 4 1
check this out as well.
Problem Loading...
Note Loading...
Set Loading...
This kills the problem.