How many of the first $100$ terms are the same in the arithmetic sequences $2,9,16,\ldots$ and $5,11,17,\ldots$? 
If $\{a_n\}$ is an arithmetic sequence with 100 terms where $a_1=2$ and $a_2=9$, and $\{b_n\}$ is an arithmetic sequence with 100 terms where $b_1=5$ and $b_2=11$, how many terms are the same in each sequence?

I think the answer is 17, but how I got it seemed too easy and I just want someone to verify my answer. Here is how I found my solution:
The sequence for
$$a_n= 2, 9, 16, 23, 30, 37, 44, 51, 58, 65, 72,79,86,93,100,107,114,121,\ldots$$
The sequence for
$$b_n= 5, 11,17, 23, 29, 35, 41, 47, 53, 59, 65, 71,77,83,89,95,101,107, \ldots$$
Ignoring the 1st four terms, I noticed that after the 4th term, the same terms appear in every 6th term for $a_n$ and 7th term for $b_n$. Therefore, $100-4=96/6=16$. Then I added $1$ to include $23$.
I hope this makes sense and thank you for your help.
 A: $16+1=17$ is too high.
$b_{100}= 599 < 695=a_{100}$ so you should not be considering any value higher than $599$ for a match
So instead consider something like $\frac{100-4}{7}+1$ and then check if it is capturing the matches you want. It does in this case, but only because $6$ and $7$ are coprime.
A better approach is to spot that the matches occur with gaps of $\operatorname{lcm}(6,7)=42$ and then look at $\frac{599-23}{42}+1$
A: The terms of $a_n$ can be written as $2+7k$, where $k$ is an integer up to $100$. The terms in $b_n$ can be written as $5+6l$, where $l$ is also an integer up to $100$. Then, we are looking for ordered pairs $(k, l)$ such that $2+7k = 5+6l$, or $7k = 6l + 3$. Since $7$ has a remainder of $1$ when divided by $6$, and $(7, 6) = 1$, this is true for $k = 3, 9, ...,99$, and corresponding $l = 3, 10, 17, ...,94$, then $91/7 + 1 = 14$ terms are the same.
A: The general formulas for the terms are:
\begin{align*}
a_{n} = 2 + (n-1)7 = 7n - 5 \\
b_{n} = 5 + (n-1)6 = 6n - 1
\end{align*}
We are looking for two integers $x$ and $y$ such that:
\begin{align*}
a_{x} &= b_{y} \\
7x - 5 &= 6y - 1 \\
x &= \frac{6y + 4}{7} \\
\end{align*}
In other words we are looking a integer $y$ such that $x$ is a also an integer. Meaning that $6y + 4$ is a multiple of $7$.
\begin{align*}
6y+4 &= 0 \mod 7 \\
6y &= -4 \mod 7 \\
6y &= 3 \mod 7 \\
2y &= 1 \mod 7 \\
2y &= 8 \mod 7 \\
y &= 4 \mod 7 \\
\end{align*}
Therefore $y$ leaves a remainder of $4$ when divided by $7$ and can be written in the form $y=7k+4$. For example, when $k = 0$, we get the pair $y = 4$ and $x = 4$ ($a_{4} = b_{4}$). When $k = 1$, we get the pair $y = 11$ and $x = 10$ ($a_{10} = b_{11}$). The largest $k$ we can plug in before $y$ is above $100$ is $13$, meaning that in total with $k = 0$ there are $14$ possible values of $k$ and $14$ terms in both sequences.
