At first glance I see a few sub-problems that don’t look hard, but the list s(n) will get huge but have a ton of repetition so you could just make a list of occurrences of each number instead of just the list of s(n), and this would make finding the nth occurrence trivial. You wouldn’t need to keep much of the list, only the fibonacci numbers.
At first glance I see a few sub-problems that don’t look hard, but the list s(n) will get huge but have a ton of repetition so you could just make a list of occurrences of each number instead of just the list of s(n), and this would make finding the nth occurrence trivial. You wouldn’t need to keep much of the list, only the fibonacci numbers.