# Equation for a sequence that is an intersection of two sequences.

If there are two sequences, $$t_k=ak+p$$ and $$t_l=bl+q$$, how to find the equation for the sequence formed by intersection of them?

For eg, given two sequences $$1,4,7,10,13,16,19,22,25... (3k+1)$$ and $$2,7,12,17,22,27... (5l+2)$$, how to arrive at the common sequence $$7,22,37... (15n+7?)$$ ?

I think that first those two equations should be equated:

$$3k+1=5l+2$$

$$3k=5l+1$$

But from here, I don't know how to go forward.

• Are the sequences integer sequences? If yes, it is essentially a Diophantine equation. One way to proceed is using modular arithmetic - you get that $3k\equiv 1\ (\textrm{mod}\ 5)$ which gives you $k\equiv 2\ (\textrm{mod}\ 5)$ or $k=5n+2$ which then gives you $3k+1=15n+7$. You can use then the initial terms of the sequences to find the initial term of the common sequence. Jun 13 at 15:19
• If those sequences have no common elements, then the intersection is empty. Otherwise, let $t_0$ be common to both: that means the sequences are of the form $ak+t_0$ and $bl+t_0$, for $k,l\in\mathbb Z$, so the intersection will be $cm+t_0$ where $t_0$ is the same value as before, $c=\operatorname{lcm}(a,b)$ (the least common multiplier) and $m\in\mathbb Z$.
– user700480
Jun 13 at 15:34
• @StinkingBishop how to find $t_0$? Apart from just trial and error. Doesn't that again require to solve $3k=5l+1$ for integer solutions? Jun 13 at 16:29