HELP!
I'm a computer science student currently taking Data Structures and Algorithms II and my professor is making the class write a series of programs he found on the internet which were used in programming contests. I'm totally stoked on where to start with this one problem. Actually I'm totally lost as to what to do and what type of data structure I should be using. Any help would be greatly appreciated. The progam is the following:
CCSNE-2002: Second Annual College Programming Contest
Problem 4: A Mod Fibonacci
Many computer scientists are familiar with the Fibonacci sequence of numbers. The first value in this sequence is 1. The second value is also 1. The third value in the sequence is the sum of the first two values which is 2. The fourth value is the sum of the second and the third values. In general, every value after the first two is the sum of the two values before it.
Now consider a mod Fibonacci sequence. Choose an integer greater than or equal to 2. The first two values of the mod n sequence are still 1 and 1 but every value after that is the sum of the previous two values mod n. For example, if n is 5, the first few values of the sequence are 1, 1, 2, 3, 0, 3, 3, 1, 4, 0, 4, 4, 3, 2,....As another example, if n is 3, the first few values are 1, 1, 2, 0, 2, 2, 1, 0, 1, 1, 2,....Call the sequence for a given n, the mod-n Fibonacci sequence.
Since the number of possible values in a mod-n Fibonacci sequence is finite, the sequence must repeat with some period. For example, the mod-3 sequence has 8 values (1,1,2,0,2,2,1,0) that repeat continuously. We will call the period of the mod-3 Fibonacci sequence 8 since the length of the repeating sequence is 8.
Write a program which will read an interger n between 2 and 5000 and determine the period for the mod-n sequence.
ok thats the whole problem. Thanks again people

