[Math] Common terms between two arithmetic series

sequences-and-series

There are two arithmetic series. There may be common terms between two sequences. We have to prove whether or not common terms between two series also form an arithmetic series. If yes what is first term and common difference of this series.

Update:

I formulated this problem while solving an algorithm design problem. Under this problem we have different base number systems (2, 3, …. 35). We are given m suffixes (s1, s2, s3,….,sm) expressed in base number systems (b1, b2, b3, …. , bm) respectively. We have to find minimum number which when expressed in bases (b1, b2, b3….,bm) has suffix string (s1,s2,s3,…sm) respectively. Alphabets used are (0,1,2….9, A,B,C,…,X,Y,Z).

For example, we have following three base-suffix pairs

5 22 (base 5 and suffix 22; a = 12,d = 25)

11 A2 (base 11 and suffix A2; a = 112,d = 121)

18 4 (base 18 and suffix 4; ; a = 4,d = 18)

In this case required output is 112 in decimal.

Numbers that satisfy base-suffix pair condition form an arithmetic series. So to find minimum number that satisfy all base-suffix pair conditions we have to find an arithmetic series whose terms are common to all arithmetic series. This is the origin of problem I stated before.

Best Answer

Suppose that $a_n=a_0+a'n$ and $b_n=b_0+b'n$ are the arithmetic progressions. If there is at most one common term, then obviously it is not an arithmetic progression, and if $a'$ and $b'$ have different signs (one is increasing and one is decreasing), then there are only finitely many common terms so it is not an arithmetic progression. Otherwise, suppose that $a_i=b_k$ and $a_j=b_m$ are the first two common terms, so that $0\le i<j$ and $0\le k<m$ (we can choose $i<j$, and $k<m$ is a consequence of the fact that the sequences are either both increasing or both decreasing).

Now let $c_n=a_i+n(a_j-a_i)$. This is an arithmetic progression, and I claim that all common terms are of this form. To see that every $c_n$ is a common term, note that since

$$a_r+(a_j-a_i)=(a_0+a'r)+(a_0+a'j)-(a_0+a'i)=a_0+a'(r+j-i)=a_{r+j-i},$$

if $a_r=b_s$ is a common term, then so is $a_r+(a_j-a_i)=b_s+(b_m-b_k)$. And then since $c_0$ is a common term, by induction every $c_n$ is.

Now suppose that $a_p=b_q$ is the $p$-minimal common term that is not equal to $c_n$ for any $n$. Since $a_i=b_k$ and $a_j=b_m$ are the first two common terms, which are equal to $c_0$ and $c_1$ by construction, we know $i<j<p$, so $p'=p-(j-i)$ is strictly between $i$ and $p$, and $q'=q-(m-k)$ is between $k$ and $q$. But by the same calculation as above, $a_{p'}=b_{q'}$, so it is a common term, and if it were a $c_n$ for some $n$ then $a_p$ would be $c_{n+1}$, so we conclude that $a_{p'}=b_{q'}$ is another common term not equal to any $c_n$, in contradiction to the minimality of $p$. Thus $c_n$ enumerates all common terms.