# Thread: Arithmetic Sequence problem and sumac sequence

1. ## Arithmetic Sequence problem and sumac sequence

1. The sequence 9, 18, 27, 36, 45, 54, … consists of successive multiples of 9. This sequence is then altered by multiplying every other term by –1, starting with the first term, to produce the new sequence –9, 18, – 27, 36, – 45, 54,... . If the sum of the first n terms of this new sequence is 180, determine n.

2. In a sumac sequence, t1, t2 , t3 ,…,tm, each term is an integer greater than or equal to 0. Also, each term, starting with the third, is the difference of the preceding two terms (that is, tn+2= tn – tn-1 1 for n ≥ 1 ). The sequence terminates at tm if tm-1- tm < 0 if .

For example:
120, 71, 49, 22, 27 is a sumac sequence of length 5.

Find the positive integer B so that the sumac sequence 150, B, . . . has the maximum possible number of terms.

2. 1. Ok, on the first one you need to recognize something special. Consider the partial summations of the sequence.

After 1 term we have -9 (no summation here).
After 2 terms we have -9+18 = 9.
After 3 terms we have 9+(-27) = -18.
After 4 terms we have -18+36 = 18.
After 5 terms we have 18+(-45) = -27.
After 6 terms we have -27+54 = 27.

I'm sure that the pattern is becoming aparent by now! After 2 $k$ terms, the sum equals 9 $k$ and so when $k$=20, you have 40 terms, which sum to 9.20 = 180 and you are done!

If you are familiar with summation notation, here is a way to get this. Your sequence is of terms $a_k = (-1)^kkA$ where $A$ is the initial number and in your case it is 9. If S_t is the sum of the first t terms, then after $2n$ terms, we have.

$S_{2n} = \displaystyle \sum_{k=1}^{2n}a_k = \sum_{k=1}^{2n}(-1)^kkA = A\sum_{k=1}^{2n}(-1)^kk$

$\displaystyle = A\sum_{k=1}^{n}(-1)^{2k}2k + A\sum_{k=1}^{n}(-1)^{2k-1}(2k-1)$

$\displaystyle = A\sum_{k=1}^{n}2k + A\sum_{k=1}^{n}(-2k+1)$

$\displaystyle = A\sum_{k=1}^{n}(2k-(2k-1))$

$\displaystyle = A \sum_{k=1}^{n}1$

$\displaystyle = nA$

Now, if we want $S_{n-1}$, we can get it by taking the following approach:

$\displaystyle S_{2n-1} = S_{2n} - a_{2n} = nA - A(-1)^{2n}2n = An - 2nA = -nA.$

So you can see that neighboring sums will give the same terms except for the sign. So you set $S_{2n} = 180 = 9n$, giving you n = 20 and 2n = 40 terms.

2. This one is not simple. I have found which B gives the longest sequence via brute force search through all possibilities. What are those possibilities? t1 = 150. t2 = B and if it is a negative number, we get t3 = t1 +|B|, which is larger than B, so t4 < 0, so disregard negative values. Similarly, if B >150, we get t3<0 and the sequence terminates quite short still. So the range of values we have to check is from B = 0 to B = 150, which is easy enough if you know how to program. I'll just tell you that the longest sequence is of length 8.

However, it is most interesting to find a "smart" solution. Here is a heuristic approach that may help you. You want the consecutive terms in the sequence to be decreasing, but decreasing as slowly as possible, since you want to create the largest sequence. Hence it makes sense to choose B large, so make that difference between terms as small as possible. However, once you obtain t3 = t1 - B, it is quite small, so that does not work. This just shows that you need to somehow balance the input B so that the difference between t1 and B is small but also the difference between B and t3 = t1 -B is small also.