S ( N ) = ∑ F p
Define the summation above for all primes p less than N .
The Fibonacci sequence { F n } is defined by F 0 = 0 , F 1 = 1 and F n = F n − 1 + F n − 2 for all integers n ≥ 2 .
It is given that
S ( 1 0 ) S ( 1 0 2 ) S ( 1 0 3 ) = ≡ ≡ 2 1 3 5 0 7 7 5 4 3 3 ( m o d 1 0 9 + 7 ) 3 4 7 0 0 0 3 6 3 ( m o d 1 0 9 + 7 )
Find the value of S ( 1 0 7 ) modulo 1 0 9 + 7 .
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
I wrote a C code for this. It took almost 0.45 seconds to run.
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 42 43 44 45 46 |
|
Problem Loading...
Note Loading...
Set Loading...
Here is the code in C++. It runs in about 100-200 ms to get the answer 2 2 3 9 7 1 1 7 8 . We precompute the primes p less than 1 0 7 and then evaluate ∑ F p .