i have this problem. Maybe you guys can help me:
Let's say i have a long sequence of integers, natural numbers, in a random order, but which repeat itself every X numbers (eg: 7 4 9 6 3 7 4 9 6 3 7...). The numbers never repeat within the sequence, so whenever you get the same value twice, you know the sequence has already repeated itself at least once
If i don't know X, but i know it is smaller than a certain number and i can get the value of any position i want, which would be the best strategy, the most efficient, to discover X?
Matt form Argentina :)
Edit: The only things i can think of right now are:
Getting the lcm of half of every possible length to see if that number matches S_1, and then proceed by discard. But this lcm would get way too big way too fast.
Another idea would be checking 2big_number to maybe be able to discard all powers of 2, then powers of 3 and so on, but this leaves many gaps.
Any ideas?