Sequence of numbers, periods, repeating subsequences...

Hi. I need to write a program that checks if a sequence of numbers entered by the user is periodic(by saying periodic I mean that the whole sequence consists only of a repeating period whose members have fixed positions in it). If the sequence is periodic then the program should output the period on the screen, but if it is not (the hardest part) the program has to check which subsequence(again whose members have fixed positions in it) is repeated more often and output that subsequence on the screen. The worst thing is that there can be other numbers between the repeating subsequences. Hope someone can help me preferably with the technical side, not only with the algorithm because I'm a beginner.

Thank you very much in advance.
Topic archived. No new replies allowed.