Prime in Nature: The Cicada (retired)
Description:
Cicadas are insects, best known for the songs sung by most, but not all, male cicadas. They make this sound by flexing their tymbals, which are drum-like organs found in their abdomens.
They also standout for another phenomena - the timespan of their life cycles. Cicadas begin life as a rice-shaped egg which the female deposits in a groove she makes in a tree limb.
When the egg hatches the cicada begins to feed on tree fluids. Once the young cicada is ready, it crawls from the groove and falls to the ground where it will dig until it finds roots to feed on. It will remain underground, tunneling and feeding, from 2 to 17 years depending on its species.
We are particularly interested in those whose years underground are a prime number. For example, the Magicicada Septendecim emerges every 17 years.
Imagine there was a year 0 A.D and at that time various types of cicada emerged. Subsequently, due to their unique cycles, the rate at which cicadas will emerge from the ground and overlap with one another will vary.
For given types of cicadas, represented by number of years spent underground, calculate the number of times particular cicada's cycles will have intertwined up to and including the current year, 2016. The cycles will have more than one unique integer greater than 0. The return value should be a whole number and we are only interested in fully completed cycles.
For example:
Cicada[3, 7]; Since 0 A.D to 2016 the Cicada's emerged together 96 times Solution: [96];
Similar Kata:
Stats:
Created | Aug 16, 2016 |
Warriors Trained | 33 |
Total Skips | 0 |
Total Code Submissions | 34 |
Total Times Completed | 15 |
JavaScript Completions | 15 |
Total Stars | 2 |
% of votes with a positive feedback rating | 50% of 5 |
Total "Very Satisfied" Votes | 2 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 6 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |