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?
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?
Depends on what you mean. If you want to find numbers such that for the same number . Then you can equate: to find out that no such number exists.
But you want to find and another index such that
We can do that with a modulo argument:
Let then consists of all natural numbers,
Let then we must find all such that
Thus is in the sequence if and only if for any .
Thus the sub-sequence is in
Or
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
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.