Lets say I have two number sequences

First: 2,7,12,17

Nth term: 5n-3

Second:-4,-1,2,5,8

Nth term: 3n-7

If I wanted to find out several numbers which exist in both sequences without doing it manually what would I do? A simultaneous equation?

Printable View

- Jun 6th 2010, 03:12 AMMukilabNumber sequences
Lets say I have two number sequences

First: 2,7,12,17

Nth term: 5n-3

Second:-4,-1,2,5,8

Nth term: 3n-7

If I wanted to find out several numbers which exist in both sequences without doing it manually what would I do? A simultaneous equation? - Jun 6th 2010, 03:59 AMDinkydoe
Depends on what you mean. If you want to find numbers $\displaystyle a_n,b_n$ such that $\displaystyle a_n=b_n$ for the same number $\displaystyle n$. Then you can equate: $\displaystyle 5n-3=3n-7$ to find out that no such number exists.

But you want to find $\displaystyle a_n$ and another index $\displaystyle m$ such that $\displaystyle a_n=b_m$

We can do that with a modulo argument:

Let $\displaystyle a_n = 5n-3$ then $\displaystyle a_n$ consists of all natural numbers, $\displaystyle a_n\equiv 2 \text{mod} 5 $

Let $\displaystyle b_m=3m-7$ then we must find all $\displaystyle m$ such that $\displaystyle b_m\equiv 2 \text{mod} 5$

$\displaystyle 3m-7\equiv 2 \text{mod} 5 \Rightarrow m\equiv 3 \text{mod} 5 $

Thus $\displaystyle b_m$ is in the sequence $\displaystyle (a_n)_n$ if and only if $\displaystyle m=5k+3$ for any $\displaystyle k$.

Thus the sub-sequence $\displaystyle (b_{5n+3}) = (15n+2)$ is in $\displaystyle (a_n), n\geq 0$

Or $\displaystyle (15n-13), n\geq 1$ - Jun 6th 2010, 04:00 AMSpringFan25

yes, that will work (you would have to be careful only to look for**integer**solutions to those equations).

It might be easier to note that every positive integer that ands in "2" or "7" is in sequence A.

So to find the common numbers, just find the terms in sequence B that end in "2" or "7" (ignore the negative ones at the start)

**edit**Too slow...again :D - Jun 6th 2010, 05:52 AMMukilab
Thanks but I didn't really understand Dinkydoe's explanation.

- Jun 6th 2010, 06:15 AMSpringFan25
Do you know what the modulo function is?

- Jun 6th 2010, 06:20 AMMukilab
No but I've used it before. I used it in a case of where I had 5 numbers on this circle and at each rotation it would go up a number and the mod functino calculated so that I had every number on every 4th rotation.

Something to do with the enigma machine.