D4. Four Operations Revisited


One of the great things about mathematics is that it’s always possible to look again at familiar things and discover something new. Sometimes this can happen when you combine well-known things in a new way.

For example, you’re probably familiar with the four basic operations of addition, subtraction, multiplication, and division. And you may have heard about various number sequences, such as the powers of two: 1, 2, 4, 8, 16, and so on. In that sequence, you obtain each term by adding the previous term to itself, or in symbols a n = a n 1 + a n 1 . Another similar sequence is the sum recurrence, also known as the Virahāṅka or Fibonacci sequence, in which you obtain each term by adding the previous term to the one before it, which can be represented as b n = b n 1 + b n 2 . The sum recurrence starts 1, 2, 3, 5, 8, 13, …

This dilemma challenges you to describe the long-term behavior of four different sequences. Unlike sequences a and b which just add one of the last two terms unchanged to the previous one, each of these sequences uses one of the four basic operations on the last two terms to determine what to add to the previous term. But first, what is meant by “long-term behavior?” The gold standard is a closed-form formula for the sequence — an expression for the n th term that just involves n , not previous terms. For example, the closed form for the powers of two is a n = 2 n . If there doesn’t seem to be a closed form, maybe you can find a formula that works when n is bigger than some number, but might be off for the first few values. Or sometimes you can find a formula that is never exactly right, but gets closer and closer as n gets large. An example of this possibility is the formula b n ϕ n + 1 / 5 for the sum recurrence, where ϕ = ( 1 + 5 ) / 2 is the golden ratio. All else failing, it could be one formula that’s always less than the sequence and another that is always greater — and hopefully you can get those two “bounding” formulas as close to each other as possible.

So all that said, can you describe the long term-behavior of each of the four following sequences? Each sequence starts with 1, then 2 (like a and b do), and thereafter adds the described quantity to the previous term to obtain the next term. If the described quantity is ever not a whole number, it should be rounded up to the next whole number.

  1. One less than the sum of the previous two terms. So to obtain the third term of this sequence, you take 1 + 2 1 = 2 , and add that to 2, to get 4.
  2. One more than the difference of the previous two terms. This time, the amount you add to get the third term is 2 1 + 1 = 2 , so the third term is again 4. (But don’t worry, this sequence will veer off from the first sequence soon!)
  3. Half the product of the previous two terms. So in this case our next increment is 2 1 / 2 = 1 , and the third term will be 3.
  4. Twice the quotient of the previous two terms. Now the next increment is ( 2 / 1 ) 2 = 4 , and the third term will be 6.

Which of these four sequences ultimately grows the slowest? You will see that by using each operation as part of an infinite cycle, we can get new, different behaviors. Happy sequence hunting!

This problem originally appeared in the Prisoner’s Dilemma in the 2022 Winter issue of the PMP Newsletter. Solutions are no longer being accepted for this Dilemma.

Show solution?  
Solution.

As submitter Jesse Waite noted, a good first step in attacking one of these sequences is to write out (in symbols) the rule defining it, known as its recurrence relation. For example, if we denote the first series connected with addition by c 0 , c 1 , c 2 , , its recurrence relation is c n + 2 = c n + 1 + c n 1 + c n + 1 = 2 c n + 1 + c n 1.

If the formula doesn’t ring a bell, a next good thing to do is write out the first several terms: c 1 = 1 , c 2 = 2 , c 3 = 4 , c 4 = 9 , c 5 = 21 , c 6 = 50 , c 7 = 120 , c 8 = 289 , and so on.

If the sequence still isn’t looking familiar, a good third step to try is to look at its “first difference sequence,” which just consists of the numbers you get by subtracting from each entry the one before it (you have to start from the second entry to do this). In this case, the sequence of first differences is 1 , 2 , 5 , 12 , 29 , 70 , 169 , 408 ,

And now, if you have some experience with sequences, you could recognize these numbers as the Pell sequence p n , a close cousin of the familiar sum recurrence (also known as the Virahāṅka-Fibonacci sequence), in which p n + 2 = 2 p n + 1 + p n (instead of having b n + 2 = b n + 1 + b n as in the sum recurrence). Another way you could figure this out is by taking these first differences symbolically. If we let c n = c n + 1 c n , then
c n + 2 = c n + 3 c n + 2 = 2 c n + 2 + c n + 1 ( 2 c n + 1 + c n 1 ) = 2 ( c n + 2 c n + 1 ) + ( c n + 1 c n ) = 2 c n + 1 + c n , exactly the recurrence for the Pell sequence.

So if the first differences of our sequence c n are the Pell sequence, then our sequence must be the sum of the first n 1 terms of the Pell sequence (well, except possibly for an initial constant, which turns out to be one). And now you can look up or use standard linear recurrence methods to find out that the formula for p n is p n = ( 1 + 2 ) n ( 1 2 ) n 2 2 .

We are only interested in the long term behavior, so note that since the absolute value of 1 2 is less than one, ( 1 2 ) n goes to zero as n grows without bound. Therefore we can ignore the second term in the numerator, and letting the constant k = 1 / ( 2 2 ) , we have that p n k ( 1 + 2 ) n . Therefore, c n k i = 0 n 1 ( 1 + 2 ) i . But this expression is the sum of a geometric sequence, which has a convenient formula. So c n k ( 1 + 2 ) n 1 ( 1 + 2 ) 1 = ( 1 + 2 ) n 1 4 .

This expression gives a very good picture of the long-term behavior of the first sequence c . (With a little more work along these same lines — don’t ignore the small term in the numerator and be careful with all of the constants — one can actually obtain an exact closed-form formula for c n . )

Turning to the next challenge, involving subtraction, Jesse noted that the first few values of the d sequence are 1, 2, 4, 7, 11, 16, 22, 29, 37, 46, … He then looked at the differences between successive numbers on this list, i.e., 2 – 1, 4 – 2, 7 – 4, and so on. That produced 1, 2, 3, 4, 5, 6, 7, etc. — a very familiar pattern! So the d sequence must be related to the triangular numbers, which are the sums of the first n natural numbers. The first six are 0, 1, 3, 6, 10, 15, so we can guess that each of the d entries is one more than the corresponding triangular number. Since the formula for the n th triangular number (starting from the first being 0) is n ( n 1 ) / 2 , we conclude that the formula we are looking for in this part of the problem is: d n = n ( n 1 ) / 2 + 1. And indeed we can check this formula by verifying that it satisfies the specified recurrence relation: 2 d n + 1 d n + 1 = 2 + n ( n + 1 ) 1 n ( n 1 ) / 2 + 1 = ( n + 3 n ) / 2 + 2 = ( n + 3 n + 2 ) / 2 + 1 = ( n + 1 ) ( n + 2 ) / 2 + 1 = d n + 2 .

About a year and a half after this Dilemma was originally proposed, PMP participant William Keehn sent in a successful approach to understanding the third sequence, e n + 2 = e n + 1 ( e n + 2 ) / 2 . He reasoned that when dealing with a lot of multiplication, it’s often helpful to take logarithms. In particular, because the number 2 appears twice in the recurrence for e n , William decided to use logs base two, and set l n = log 2 e n (so that also e n = 2 l n ). He calculated that the sequence of l n values starts 0 , 1 , 1.5849625 , 2.5849625 , 3.90689 , 5.90689 , 8.99435 , 13.9485 , and so on.

These numbers are looking very reminiscent of the familiar Virahāṅka-Fibonacci (VF) sequence b n mentioned in the statement of the problem. That resemblance turns out to be no surprise: if we take log base 2 of both sides of the recurrence for e n , we get l n + 2 = l n + 1 + log 2 ( e n + 2 ) 1. We still would like to get rid of the remaining e n in this expression to put it entirely in terms of the l sequence, so we use a technique known as Standard Expert Trick #367: Add zero.

The key to using this trick is to find the right term to both add and subtract (in effect, adding zero) to simplify this expression. In our case, we would like an l n term, so we try adding 0 = l n log 2 ( e n ) to get l n + 2 = l n + 1 + l n 1 + log 2 ( ( e n + 2 ) / e n ) . As ( e n + 2 ) / e n = 1 + 2 / e n = 1 + 2 1 l n , we convert back to natural log to take advantage of the series expansion of ln ( 1 + x ) near x = 0 : l n + 2 = l n + 1 + l n 1 + 1 ln 2 ln ( 1 + 2 1 l n ) = l n + 1 + l n 1 + 1 ln 2 ( 2 1 l n 2 1 2 l n + 2 3 3 l n / 3 ) .

We can see from this expression and the initial values above that the l n are growing rapidly, like the VF series, so all of the terms in parentheses become large negative powers of two, and quickly become entirely negligible. In other words, as n grows, l n + 2 l n + 1 + l n 1 . More directly, we observe that l 4 > b 2 + 1 and l 5 > b 3 + 1 , and that if l n + 1 > b n 1 + 1 and l n > b n 2 + 1 , then l n + 2 > l n + 1 + l n 1 > b n 1 + 1 + b n 2 + 1 1 = b n + 1 . So by induction, we conclude that for all n > 3 , l n > b n 2 + 1 . (Moreover, using the estimates above we can actually show that l n b n 2 + 1 as n grows.) In any case, converting back to the original series, we have our lower bound (which turns out to be very close in the long run): e n > 2 b n 2 + 1 .

Jesse Waite cracked the fourth sequence. Examining the first several terms was again the key: they are 1, 2, 6, 12, 16, 19, 22, 25. etc. In this case, the successive differences seem to be settling down to always be equal to three. And looking at the recurrence verifies this: once two successive entries f n and f n + 1 are at least seven and differ by three, then f n + 1 / f n is between 1 and 1.5. Therefore 2 f n + 1 / f n is between 2 and 3, which means f n + 2 = 3 + f n + 1 , and so the next pair also differ by three (and are still at least seven) and the pattern continues. Hence, as Jesse concluded, f n = 3 n + 1 for n > 4 .

We are now in a position to answer the final question of Dilemma 4: which sequence grows the slowest? Looking at all the expressions we derived, c n grows exponentially. Multiplying out the exact formula d n = n 2 / 2 n / 2 + 1 shows that it grows quadratically. Except for a few terms at the beginning, f n is linear. And since the VF sequence itself grows exponentially, e n is the monster of the lot and grows double-exponentially.

Of these, division produces the slowest-growing sequence. To be sure, PMP participant Robert Noll sent a letter pointing out (a) guessing that division leads to slow growth would have been a good bet right from the start, and (b) we didn’t need an asymptotically correct formula for e n to see that it couldn’t be the slowest growing: It is very easy to prove the much weaker lower bound that e n > 2 n 2 , which already makes it grow faster than any quadratic function, let alone linear.

Nevertheless, in figuring out at least decent approximations for each of these series, and exact formulas where possible, we encountered many different problem-solving techniques. That’s a lot of mileage from just the four basic arithmetic operations!