Interesting sequences question Olympiad style

280 Views Asked by At

Let a sequence of n numbers be called good if there exists 2p consecutive numbers somewhere in the sequence such that, of these 2p numbers, each pair of numbers with distance p from each other are equal. (e.g. 1,3,2,4,3,2,4,6,7 - here, p=3 for the numbers 3,2,4,3,2,4) Note that p is arbitrary. (By consecutive, I mean consecutive placings in the sequence.)

What is the least n such that the sequence of n numbers from the set 1,2,3,...,k(allow repeats and exclusion of numbers) is not good, but its extension with an extra n+1 th number is good for any n+1 th number from the set 1,2,3,...k.

I have an idea like this: ...,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1. If you add 1 to the end, the last two numbers 1,1 make the sequence trivially good. If you add 2, then 1,2,1,2 makes the sequence good. If you carry on in this way, you get (2^k)-1. (This is probably not the least n, but it is an idea.)