Problem 56050. Easy Sequences 73: Emergence of Fibonacci Insects
Cicadas are natural mathematicians. In order to avoid their natural predators (in this case, the wasp), they emerge from hibernation in "a prime number" of years. For example, if the emergence period of a wasp is every years, selecting 4 or 6 or even 9 years emergence period for the cicadas, means that their population would be wiped out in a few years. But, by selecting a prime emergence period, say years, they are assured not to meet their predators for a very long time. In this case, if cicadas and wasps emerged the same time today, it would take another years for them to again see each other.
In a theoretical environment, a particular species of cicadas selects to emerge every (n-th Fibonacci number) days, while the predator wasps selects emergence period of (m-th Fibonacci number) days. Given the values of n and m, and assuming that the insects emerge at the same time, today, in how many days will they again emerge together.
For example, if the cicadas selected , and the wasps chose , they will emerge at the same time again in days.
NOTE: You are given: and . Since the answer can be a huge number, please present your answer "modulo ".
Solution Stats
Problem Comments
-
6 Comments
Show
3 older comments
Ramon Villamangca
on 29 Sep 2022
Hi Tim, please consider that modulus of Fibonacci numbers are periodic...
GeeTwo
on 8 Dec 2022
This should be part of the problem statement (test case 10):
Not Allowed in solution:
'persistent' 'global' 'BigInteger' 'java'
(OK so far, but also)
'if' 'for' 'switch' 'while' 'try'
Ramon Villamangca
on 9 Dec 2022
Hi Gee, thanks for the comment. However, I don't think there is need to include it in the problem statement coz players can already clearly see the blocked functions in test 10.
Solution Comments
Show commentsProblem Recent Solvers3
Suggested Problems
-
3185 Solvers
-
Find the alphabetic word product
3366 Solvers
-
252 Solvers
-
36 Solvers
-
Find terms in the Connell sequence
30 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!