Puzzle involving arithmetic series - will this game always end

419 Views Asked by At

I'm playing a game. I get a short sequence of increasing numbers, and I try to "fill in the blanks" using the minimal distance between two consecutive elements.

For example. Suppose I got the sequence $x_1 = 1,4,7,13, 22$. The minimal distance is $d=3$, the initial value is $1$.

I will then output the sequence $y = 1, 4, 7,10,13,16,19,22$

Easy stuff.

The hard part begins when the numbers don't line up correctly

Suppose I got the sequence $x_1 = 1, 3, 6,8$. The minimum distance is $d=2$, the initial value is $1$

So I will output $y=1,3,5,6,7,8$.

But that is an incorrect output since that's not an arithmetic series. So I will do it again, this time with $x_2 = 1,3,5,6,7,8$. The minimal distance is $d=1$, the initial value is $1$, so I will output $y = 1,2,3,4,5,6,7,8$

My question is - Is the game guaranteed to always end? Will I eventually reach an arithmetic series, on any initial input? or are there inputs that I will get closer and closer to arithmetic without actually reaching it.

Edit: In case it wasn't completely clear, the input sequence we were given may use rational numbers. $1, 3, 6, 6.4$ is a valid input, for instance.

1

There are 1 best solutions below

5
On BEST ANSWER

I assume that the sequence is a sequence strongly monotonic increasing rational numbers.

Proposition 1: It will end if it is an integer sequence.

Proof: You can add only finitely many additional numbers to the sequence $\left<a_1,\ldots,a_n\right>$ because the numbers must be between $a_1$ and $a_n$.

When the process ends with the difference $d$ it can be shown that
$$d=\gcd(a_2-a_1,\ldots,a_n-a_{n-1})$$

If it is a rational sequence then you can multiply the sequence members by their smallest common denominator and get an integer sequence.

Example: $$\left< \frac{1}{3}, \frac{1}{2}, \frac{3}{5} \right> \tag{1}$$

The smallest common divisor is 3030. We multiply the sequence by $30$ and get $$\left<10,15,18 \right>$$. After processing it in the way you described we will end with $$\left<10,11,12,13,14,15,16,17,18 \right>$$ dividing by 3030 results in $$\left< \frac{1}{3}, \frac{11}{30}, \frac{2}{5}, \frac{13}{30}, \frac{7}{15}, \frac{1}{2}, \frac{8}{15}, \frac{17}{30}, \frac{3}{5} \right>$$ This is the same sequence that you will get if your directly process $(1)$.