Writing the rule for a sequence

fermarg

New member
Joined
Apr 16, 2016
Messages
1
I know how to write a simple rule for a sequence like:

{2, 4, 6, 8, 10, 12, 14, 16, 18, 20, ...} A(n)=2n


but how can I write a rule for sequences like this ?

{2, 4, 6, 12, 14, 16, 22, 24, 26, ...}

or

{2, 4, 10, 12, 14, 20, 22, 28, 30, 32, ...}


and how do I write the rule to start at number 4 and end at 22 ?

Thanks in advance.
 
...but how can I write a rule for sequences like this ?

{2, 4, 6, 12, 14, 16, 22, 24, 26, ...}

It looks to me like the rule for this sequence, written in plain English would be: "Add 2, Add 2, Double, Add 2, Add 2, Double..." Since each term in the sequence is determined by the previous one, I'd make use a recursively defined sequence. Further, because the exact operation used depends on the index (which term you're on), I'd use a piecewise defined function. Something like this:

\(\displaystyle a_0 = 2 \\
a_n = \begin{cases}
a_{n-1} \: ??, &\text{if } a_n \equiv 0 \\
a_{n-1} \: ??, &\text{if } a_n \not\equiv 0
\end{cases} \pmod{3} \)

In other words, if n is divisible by 3, you (insert operation) to the previous element in the sequence. If n is not divisible by 3, you (insert operation) to the previous element in the sequence. Then you can apply similar logic for the other sequence.

and how do I write the rule to start at number 4 and end at 22 ?

This statement is ambiguous. Do you mean you want a sequence where the general rule is a(n)=2n, but you start at 4 and end at 22? If so, think about how each element relates to 2n. For n=1, what is the value of 2n? How does that relate to the desired value of 4? For n = 2, what is the value of 2n? How does that relate to the desired value of 6?

If instead, you mean taking either of the other two sequences you outlined and start at 4, that's no problem at all. Because the sequences are recursively defined, the first element must be manually defined. So just declare that the sequence starts with a(0)=4 instead of a(0)=2.
 
I know how to write a simple rule for a sequence like:

{2, 4, 6, 8, 10, 12, 14, 16, 18, 20, ...} A(n)=2n


but how can I write a rule for sequences like this ?

{2, 4, 6, 12, 14, 16, 22, 24, 26, ...}

or

{2, 4, 10, 12, 14, 20, 22, 28, 30, 32, ...}


and how do I write the rule to start at number 4 and end at 22 ?

Thanks in advance.
Problems like this are generally a matter of trying things until you recognize something [or just use something like https://oeis.org/ ]

Some different things to try are simple differences [subtract the present value from the last value to form a new reduced sequence], common ratios [divide the present value by the last value to form a new reduced sequence], and others. You may sometimes need to try a combination of things or perform the operation again (and again, and again, and ...) on the reduced sequences.

For these problems, it looks like simple differences will work:
Code:
[FONT=courier new](1) (2)(3) (4)(5)
 2   4  6   8  10  ...
   2   2  2   2
So a 1st difference being constant means a linear equation [with a slope of the constant].  
So given point(1,2) provides (n,2n), i.e a[SUB]n[/SUB]=2n.

(1) (2)(3) (4) (5)  (6) ...
 2   4  6   12  14  16  22  24  26 ...
   2   2  6    2   2   6   2   2 
So this one is a little more complex but you should see the 
pattern, differences of 2, 2, and 6, then repeat.

(1) (2) (3) (4) (5)  (6) ...
 2   4   10  12  14   20  22   28   30   32 ...
   2   6   2   2    6   2    2    2    2
Again more complex.  There are 2[SUP]0[/SUP] twos and a six, then 2[SUP]1[/SUP] two's then a six, 
then 2[SUP]2[/SUP] two's then (?) a six, ...[/FONT]
As I said, you play around until you (think you) recognize something. The more of these you do the more you can recognize.

As a final word, you can actually build an infinite number of functions (polynomial+the product of another polynomial and an arbitrary function) with the given sequence, so you never really know what the proper answer is. There is a story about a famous mathematician/scientist who failed a test of determining a (set of) formula(s) for a set of sequences, yet all the answers he gave satisfied the conditions. He just happened to see different pattern that the usual person didn't. I don't know if the story is true or not but it certainly could be.
 
I know how to write a simple rule for a sequence like:
{2, 4, 10, 12, 14, 20, 22, 28, 30, 32, ...}.
I can assure you that no professional testing company would ask such a question.
Look at the website in reply #4. There are not unique answers.

You may be asked to construct a sequence:
\(\displaystyle a_0=3\) and if \(\displaystyle n>0\) then \(\displaystyle a_n=(n \mod 3)a_{n-1}+1\).
Write the first five terms of the sequence.
 
Last edited:
I can assure you that no professional testing company would ask such a question.
Look at the website in reply #4. There are not unique answers.

You may be asked to construct a sequence:
\(\displaystyle a_0=3\) and if \(\displaystyle n>0\) then \(\displaystyle a_n=(n \mod 3)a_{n-1}+1\).
Write the first five terms of the sequence.
As I mentioned, there are never unique answers. Given any finite sequence S1={a1, a2, a3, ..., an}, there are an infinite number of infinitely differential functions f(x) such that f(j)=aj; j=1,2,3,...n.
 
Top