# Find the number of terms common in two sequences

How many terms do the two sequences $S_1$ and $S_2$ have in common?

$S_1 = 1, 3, 6, 10, 15\dots$ up to $200$ terms.

$S_2 = 3, 6, 9, 12, 15\dots$ up to $200$ terms.

I need to know the number of common terms in these two sequences (irrespective of their position in respective series.)

For example, $3,6$ and $15$ are a few of the common terms in these two sequences, but I need to know the exact number of common terms.

My approach:

$n^{th}$ term of $S_1 = \dfrac{[n(n+1)]}{2}$

$k^{th}$ term of $S_2 = 3k$

Now for common terms:

$\dfrac{[n(n+1)]}{2} = 3k$

Which gives:

$n(n+1) = 6k$

Had the above equation been linear in terms of $n$ and $k$ then I might have been able to solve it for possible integral values of $k$ and $n$ but now I am stuck here and don't know how to proceed further. Kindly provide assistance in solving this further.

• @Rohan, please don't edit posts only to add small embellishments. Even more, please don't do this on old, inactive posts. I understand that you are looking for badges and reputation, but please try to gain them in more useful and respectable ways. – Alex M. Dec 5 '16 at 15:37

The question is: For how many $n\ge1$ is $\frac{n(n+1)}{2}$ a multiple of $3$ and $\le 600$?

We first check that $\frac{n(n+1)}{2}\le 600$ iff $n\le 34$ (this is because $\lfloor\sqrt{1200}\rfloor = 34$). Next, the integer $\frac{n(n+1)}{2}$ is a multiple of $3$ iff $n$ or $n+1$ is a multiple of $3$, that is unless $n\equiv 1\pmod 3$. Thus two thirds of the $33$ numbers $n=1,\ldots, 33$ lead to a common term. The remaining $n=34$ is $\equiv 1\pmod 3$, so does not add another solution. Thus the answer is $22$.

You get a match any time $n$ is divisible by $6$, $(n+1)$ is divisible by $6$, or when $n$ is divisible by $2$ and $(n+1)$ is divisible by $3$, or vice-versa. The cases when one term is divisible by 6 imply that the term is divisible by 3. For the other cases, note that if $n$ or $(n+1)$ is divisible by 3 (and not 6), then they are odd (i.e. of the form $3(2m + 1)$ for some $m \geq 0$), and when this happens, then the other term is guaranteed to be even so you still get a solution. So you get a match precisely when either $n$ or $(n+1)$ is divisible by 3, subject to the condition that you want $n(n+1)/2$ to be less than or equal to $3N$ where $N$ is the length of your sequences; if you want me to work the formula out, let me know and I can update the post, but you said you can enumerate linear-type cases so this should give you all you need.

First sequence : triangle numbers Second Sequence : multiples of 3

This is basically finding triangle numbers that are multiples of 3 . now observing pattern . 1,3,6,10,15,21,28,36,45,55,66,78 ....

PATTERN OBSERVATION :

For every 3 consecutive terms, 2 terms are multiples of 3

Note: multiples of 3 are only till 600 , so triangle numbers after 600 are to be eliminated . as triangle number of 34 ( 34th term in 1 st sequence) is 595 <600

triangle number of 33 ( 33rd term in 1 st sequence) is 561 which is a multiple of 3 .

so we should stop here .

so till n=33 , we have 11 triplets(because $11 \times 3 = 33$ ) , in each triplets we have 2 numbers which are divisible by 3 (as per our observation), so $11 *2$ = $22$ is the answer

I thinks 132 is the answer. EXPLANATION : The common term needs to be of the form of $3k$ as well as $\frac{n(n+1)}{2}$. When $\frac{n(n+1)}{2}$ is divided by 3, it can only give 3 remainders i.e 0,1 or 2.We are interested in finding the values of $n$ which will give '0' remainder (as already said,the number also needs to be of the form $3k$) So, $n$ can only take any of only three forms when when written as multiple of 3: $\{3k+1;3k+2;3k\}$ so:

• for $n = 3k$ form REM : 0
• for $n = 3k + 1$ form REM : 1
• for $n = 3k + 2$ form REM : 0 (as can be checked by remainder's theorem)

that is 2 out of every 3 numbers $\{3k+1;3k+2;3k\}$ (for $k \in \{1,2,\ldots,200\}$ gives 0 remainder on dividing by 3, e.g. $\frac{200}{3}\times 2 = 132$.

NOTE: 200 can be replaced by 198 as last two terms of first series will not be divisible by 3 or alternately the last two numbers of second series will not be consecutive sums of natural number.