-
-
Save RandyMcMillan/47e8c9e416dce07bab57959619b14a72 to your computer and use it in GitHub Desktop.
Problem 618
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compute(limit): | |
d = [1] + [0] * limit | |
primes = eulerlib.primes(limit) | |
mod = 10**9 | |
Fibonnaci_numbers = [2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368] | |
for p in primes: | |
for i in range(p,limit+1): | |
d[i] += (p*d[i-p] % mod) | |
total = 0 | |
for x in Fibonnaci_numbers: | |
total += (d[x] % mod) | |
return total % mod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment