Sequences

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Some Very Interesting Sequences

John H. Conway and Tim Hsu


July 6, 2006

1 Introduction
First of all, we hope that anyone reading this is a Nerd. (Certainly the authors
are, and quite proud of it!) Nerds have been interested in sequences of numbers
throughout the ages, perhaps ever since Nerds have existed, and since well be
discussing some of our favorite sequences and their remarkable properties, lets
face it only a real Nerd is likely to be interested.
So everyone reading this far is a Nerd, then? Great! Lets begin.

2 Fibonacci
As Nerds, you have probably already seen the Fibonacci sequence at some point:
0 1 1 2 3 5 8 13

As you may remember, the rule for the Fibonacci sequence is that the first two
terms are 0 and 1, and thereafter, each term is the sum of the previous two.
Of course, theres nothing special about starting with 0 and 1; we might well
start with, say, 1 and 3:
0 1 1 2 3 5 8 13
1 3 4 7 11 18 29 47
In fact, some of you may recognize this second sequence as the Lucas sequence,
though the Lucas sequence usually begins 2, 1, 3,. . . .
What you may not know is that there is a way to choose infinitely many of
these rows that has many surprising properties! To wit:
0 1 1 2 3 5 8 13
1 3 4 7 11 18 29 47 (you
2 4 6 10 16 26 42 68 fill
3 6 in
4 8 the
5 9 rest
6 11 . . .)

1
This particular choice of the initial two columns produces an infinite array, to
the right of the dividing line, called the Wythoff Array. As first discovered by
mathematician David Morrison [7] in 1980, the Wythoff Array has the wonderful
property that every positive integer appears exactly once in it (again, to the right
of the dividing line). Try filling in some more of the Wythoff Array to see that
this works, at least in rows 0 through 6.
The only part of the rules producing the Wythoff Array that may still be
unclear is how we choose the numbers in the first two columns. The first column
is easy: take the obvious sequence 0, 1, 2, 3,. . . . As for the second column, in
the row that begins with the number n, find the place in the Wythoff Array (i.e.,
to the right of the dividing line) where n appears, take number that appears
immediately after that, and add 1. For example, since 5 appears in the top
row of the Wythoff Array, and the number that comes after 5 is 8, the second
number in row 5 is 9. Similarly, the number that comes after 6 in the Wythoff
Array is 10, so row 6 begins 6 11 | . Try to start the next two rows (rows 7
and 8) to see if you understand the rule. (Answers below.1 )

3 Speak, Say
Now how about this one? Here are the first few terms:
1, 11, 21, 1211, 111221,. . .
Do you see the pattern yet? Its not easy; neither of us got it on the first
try. How about some more terms, picking up where we left off:
. . . , 312211, 13112221, 1113213211, . . .
Seen enough? Or perhaps we should say, have you heard enough? If you
still dont hear the pattern, try saying each term (after the initial 1) out loud:
one one, two one, one two, one one, one one, one two, two one,. . .
This sequence is therefore called the Speak-and-say sequence: Each term
comes from reading the previous one out loud. (Can you figure out the next
two terms we havent supplied? Answers below.2 )
It may surprise you to hear that we can actually come to some mathemati-
cally interesting conclusions about the Speak-and-say sequence. For example,
JHC (the first author) proved that as n goes to infinity, the nth root of the nth
term approaches a limit 1.3 . . ., where is a root of a certain polynomial of
degree 71. In fact, JHC and Richard Parker showed that no matter how you be-
gin the sequence, this same limiting property holds for any sequence constructed
by this rule with one exception. Can you find the exception, which simply
repeats the same term ad infinitum? (Answers below.3 )
1 Rows 7 and 8 begin 7 12 | and 8 14 | , respectively.
2 The terms after 1113213211 are 31131211131221 and 13211311123113112211.
3 The exception is 22, 22, 22,. . . .

2
As a historical note, the limiting property (or more generally, JHCs Cos-
mological Theorem) was first proved in the late 1970s, as described above, but
the details of that original proof, which included a long check of various cases,
were lost for some time. Then in 1997, Shalosh B. Ekhad and Doron Zeilberger
used a computer program to automate the case check and thus recover the proof;
in fact, their program was able to recreate much of the proofs of JHC and Parker
from scratch, that is, without having to tell the computer what the answer is
beforehand. The interested reader should consult Ekhad and Zeilberger [3] for
details.

4 Stern and Fractran


Suppose, for reasons well reveal in a bit, we consider the following Fibonacc-ish
function:

f (0) = 0, f (2n) = f (n),


f (1) = 1, f (2n + 1) = f (n) + f (n + 1)

f (n)
Write this sequence out, and then look at the fractions formed by
f (n + 1)
pairs of consecutive terms:

n: 0 1 2 3 4 5 6 7 8 9
f (n) : 0 1 1 2 1 3 2 3 1 4
f (n) 0 1 1 2 1 3 2 3 1
:
f (n + 1) 1 1 2 1 3 2 3 1 4

This sequence f (n) = 0, 1, 1, 2, 1, 3, . . . is called Sterns diatomic series, and


has the remarkable property that every nonnegative rational number (i.e., every
ratio of two positive integers, along with 0=0/1) appears exactly once in the
f (n)
sequence of fractions, a fact discovered in 1858 by the mathematician
f (n + 1)
Moritz A. Stern.
Another sequence arising from fractional fun can be found in the following
fourteen fractions:
A B C D E F G H I J K L M N
17 78 19 23 29 77 95 77 1 11 13 15 15 55
91 85 51 38 33 29 23 19 17 13 11 14 2 1
The integer sequence coming from that list is made by starting with the num-
ber 2, and then repeatedly multiplying by the first fraction in the list that will
produce an integer. For example, since the first fraction where the denominator
15
divides 2 is M = , the second term in the sequence (after 2) is 2M = 15.
2
Since none of the denominators divide 15 except the denominator of the last
55
fraction N = , the third term in the sequence is 15N = 3 52 11 = 825.
1

3
Continuing in the same vein, the first few terms are:

2, 15, 825, 725, 1925, 2275, 425, 390, 330, 290, 770, 910,
170, 156, 132, 116, 308, 364, 68, 4 = 22 , . . .

We note that 4 = 22 because it turns out that the only powers of 2 that appear
in this sequence follow the pattern:

2 . . . 22 . . . 23 . . . 25 . . . 27 . . . 211 . . . 213 . . .

In other words, the only powers of 2 appearing in this sequence are the numbers
2p , where p is a prime number, in the correct order!
So whats the secret, you ask? The answer is that those 14 fractions A
through N are actually a very cleverly encoded computer program for listing
the prime numbers. (For those of you familiar with the Sieve of Erastosthenes,
the program tries to divide each positive number by all of the previous ones, and
when it finds a number n that can only be divided by 1 and itself, it displays
the power 2n .) In fact, the language in which this program is written is called
FRACTRAN, and one can even show that in theory, any computer program
can be re-written in FRACTRAN. (This is admittedly true of most computer
languages, but still, a notable fact.)
It is worth mentioning that subsequent to JHCs discovery of the above four-
teen fraction program for the primes, in 1999, a doctoral student in mathematics
at the University of Western Australia named Devin Kilminster (now a lecturer
at Oxford University), devised a prime program in FRACTRAN using only ten
fractions [5]:

A B C D E F G H I J
7 99 13 39 36 10 49 7 1 91
3 98 49 35 91 143 13 11 2 1
In Kilminsters version, we start with the number 10, and the only powers of 10
appearing in the sequence are the numbers 10p , where p is a prime number, in
the correct order.

5 Tangent, Secant, Triangles, Zigzag Permuta-


tions
Those of you who have taken calculus may have seen that:
x1 x3 x5 x7
sin x = + + ...
1! 3! 5! 7!
x0 x2 x4 x6
cos x = + + ...
0! 2! 4! 6!
for all real numbers x, where x is measured in radians. For those of you who
havent taken calculus, fret not; to convince yourself that these formulas work,

4
get a good calculator, make sure the calculator is in radians mode, pick your
favorite relatively small value of x, like x = 0.1 or so, and try comparing both
sides of each equation yourself. Of course, since the right-hand sides of these
equations go on forever, you wont quite get whats on the left-hand side, but
the farther out you go, the closer youll get. (After all, how do you think your
calculator computes sin x and cos x?)
Now, the pattern in the sequence of coefficients in the series expansions of
sin x and cos x should be fairly clear. On the other hand, the coefficient patterns
in the following similar but lesser-known expansions are harder to see:

1x1 2x3 16x5 272x7


tan x = + + + + ...
1! 3! 5! 7!
1x0 1x2 5x4 61x6
sec x = + + + + ...
0! 2! 4! 6!
Can you see a pattern in the sequence 1, 2, 16, 272,. . . or the sequence 1, 1,
5, 61,. . . ? The answer lies in the zigzag triangle:

1
0 1
1 1 0
0 1 2 2
5 5 4 2 0
0 5 10 14 16 16
61 61 56 46 32 16 0

The secant numbers, or zig numbers, or Euler numbers (see below for more on
Euler), can be seen on the left-hand border of the triangle, and the tangent
numbers, or zag numbers, are on the right-hand border of the triangle (after the
first row). In fact, the secant and tangent numbers also appear as the row sums
of the triangle can you see how?4
The zigzag triangle is constructed by starting with 1 in the top row, starting
each succeeding row with 0, alternating left-to-right rows with right-to-left rows
(the boustrophedon rule), and then applying the zigzag addition rule

a
b (a + b)

in the direction indicated by the arrows. Can you figure out the entries in the
next row of the zigzag triangle?5
Now, the numbers in the series expansions of important functions usually
count something, and the tangent and secant numbers are no exception; they
count zigzag permutations. A zigzag permutation of 1, . . . , n is an arrangement
4 The tangent numbers are the sums of the rows with s, and the secant numbers are the

sums of the rows with s.


5 The next row is constructed from left to right, and looks like 0 61 122 178

224 256 272 272.

5
of the numbers 1 through n in a way so that the numbers alternately increase
and decrease. For example, 14253 is a zigzag permutation of 1, 2, 3, 4, 5, whereas
15234 is not a zigzag permutation (why not?).
To give more examples, for n = 1, 2, 3, 4, the nth row of the following table
lists all zigzag permutations of 1, . . . , n, ordered by the last number in the
permutation.
n=1 1
n=2 none; 12
n=3 231; 132; none
n=4 none; 3412; 1423, 2413; 1324, 2314
Note that if we now list the number of zigzag permutations of a given length
ending in a given digit, we get a triangular table that starts out 1 (row 1), 0, 1
(row 2), 1, 1, 0 (row 3), 0, 1, 2, 2, . . . . Look familiar? Thats right, its precisely
the first four rows of the zigzag triangle! Indeed, the pattern continues, and in
general, the kth entry of row n of the zigzag triangle gives the number of zigzag
permutations of 1, . . . , n that end in k.
With that in mind, from the zigzag triangle, we see that there are 5 zigzags
of length 5 that end in the number 1, 5 that end in 2, 4 that end in 3, 2 that
end in 4, and 0 that end in 5. Can you find all 16 of the zigzag permutations of
1, 2, 3, 4, 5?6

6 Triangles, Squares, Pentagons, Hexagons, and


Eulers Partition Formula
As Nerds, you have almost certainly thought about the triangular numbers and
the squares:

The triangular numbers The squares


1, 3, 6, 10, . . . 1, 4, 9, 16, . . .

You may have also noticed that both the triangular numbers and the squares
are sums of numbers in a particular arithmetic progression:

The triangular numbers as sums The squares as sums


1 + 2 + 3 + 4 + 5 + ... 1 + 3 + 5 + 7 + 9 + ...
6 Theyare, ordered by final digit: 24351, 25341, 34251, 35241, 45231; 14352, 15342, 34152,
35142, 45132; 14253, 15243, 24153, 25143; 13254, 23154.

6
More generally, for p = 3, 4, 5, . . . , we may define the p-gonal numbers to
be the sums of the arithmetic progression that begins 1, p 1, 2p 3, . . .. For
example, the pentagonal numbers are the sequence 1, 1 + 4 = 5, 1 + 4 + 7 = 12,
and so on, and they can be drawn as follows:

Its actually not too hard to come up with a formula for the nth pentagonal
number; just remember that the sum of a finite arithmetic progression is the
number of terms times the average of the first and last term. Therefore, since
the first term of 1, 4, 7, . . . is 1, and the kth term is 1 + 3(k 1) = 3k 2, we
see that the kth pentagonal number, which is the sum of the first k terms of
1, 4, 7, . . ., is equal to
 
1 + (3k 2) k(3k 1)
k = .
2 2
In fact, since this formula produces an integer for both positive and negative
integer values of k, we may use this formula to define the (1)st pentagonal
number, the (2)nd pentagonal number, the (3)rd, and so on. For example,
writing out the kth pentagonal number for 4 k 4, we get:
26 15 7 2 0 1 5 12 22
Can you see what the 5th and (5)th pentagonal numbers are?7
Pentagonal numbers also have some more surprising properties. For example,
comparing the following picture of triangle numbers and the preceding picture
of the pentagonal numbers, we see that every pentagonal number is one-third
of a triangular number:

Algebraically, we can see this by noting that 3 times the kth pentagonal number
is  
k(3k 1) (3k)(3k 1)
3 = ,
2 2
7 The 5th and (5)th pentagonal numbers are 35 and 40, respectively.

7
which is the (3k 1)th triangle number, when k > 0. (Can you see why?
Whats a formula for the nth triangle number?) In fact, even if k is negative,
(3k)(3k 1) (3(k))(3(k) + 1)
= is the (k)th triangle number, and con-
2 2
versely, its not much harder to see that if a triangle number is divisible by 3,
then when you divide it by 3, you get a pentagonal number, for either positive
or negative k.
Another, more profound, property of pentagonal numbers was discovered by
the great 18th century mathematician Leonhard Euler. To explain this property,
we need to describe the sequence of partition numbers. This is the sequence p(1),
p(2), p(3), etc., where p(n) is the number of ways you can express the integer n
as a sum of positive integers. For example, since

4 = 3 + 1 = 2 + 2 = 2 + 1 + 1 = 1 + 1 + 1 + 1, and
5 = 4 + 1 = 3 + 2 = 3 + 1 + 1 = 2 + 2 + 1 = 2 + 1 + 1 + 1 + 1 = 1 + 1 + 1 + 1 + 1,

p(4) = 5 and p(5) = 7.


In these terms, Eulers pentagonal number theorem says that for n > 1,

p(n) = p(n 1) + p(n 2) p(n 5) p(n 7) + p(n 12) + p(n 15) ,

where the sum runs over all pentagonal numbers less than n, including those
coming from k < 0. The signs alternate in the pattern +, +, , , and so on.
Incidentally, the hexagonal numbers 1, 6, 15, 28, . . . defined above may not
be the numbers that you would think of first when you think about hexagons;
you may first think of the hex numbers 1, 7, 19, 37, . . . :

It is an amusing fact that the sum of the first n hex numbers is precisely n3
(try it!). Why? Well, every hex number hexagon can be seen as a corner of a
cube, as indicated by the lines in the above hexagons. By nesting the first n of
these corners, one inside another, we can assemble a complete n n n cube,
which of course contains n3 dots.

7 Moessners Magic Sequence Generator; Sums


of Powers and Bernoulli (or really, Faulhaber)
numbers
Next, we consider a discovery made by mathematician Alfred Moessner in the
1950s. In the simplest case of Moessners magic, start by taking the positive

8
integers and boxing the even ones:

1 2 3 4 5 6 7 8 9 10 11 12

Now look at what happens when you sum up the unboxed terms, one by
one. (For reasons of uniformity, we also box these final results.)

1 2 3 4 5 6 7 8 9 10 11 12
1 4 9 16 25 36

You get the squares, for exactly the same reasons (1+3+5+. . . ) as the previous
section.
Suppose that instead, we start by boxing every integer divisible by 3:

1 2 3 4 5 6 7 8 9 10 11 12

Summing up terms, like before, we get:

1 2 3 4 5 6 7 8 9 10 11 12
1 3 7 12 19 27 37 48

If we now box every integer coming right before a box in the first row, and take
sums again, we get:

1 2 3 4 5 6 7 8 9 10 11 12
1 3 7 12 19 27 37 48
1 8 27 64

That is, we get the cubes.


Can you guess what happens if we start by boxing every fourth integer and
proceed as before? Try it!8
Indeed, Moessners magic can be used to produce not only sequences of nth
powers, but also many other similar sequences. For example, if we begin by
boxing the triangular numbers 1, 3, 6, 10, . . . and take sums as before:

1 2 3 4 5 6 7 8 9 10
2 6 11 18 26 35
6 24 50
24

We get the factorial numbers 1 = 1!, 2 = 2!, 6 = 3!, 24 = 4!, . . . .


8 We get:

1 2 3 4 5 6 7 8 9 10 11 12
1 3 6 11 17 24 33 43 54
1 4 15 32 65 108
1 16 81
In other words, we get the sequence of fourth powers.

9
In general, the pattern is:

If we start by boxing: 1 + 1, 2 + 2, 3 + 3, . . .
the final result is: 1 1, 2 2, 3 3, . . .

If we start by boxing: 1 + 1 + 1, 2 + 2 + 2, 3 + 3 + 3, . . .
the final result is: 1 1 1, 2 2 2, 3 3 3, . . .

If we start by boxing: 1, 1 + 2, 1 + 2 + 3, . . .
the final result is: 1, 1 2, 1 2 3, . . .

And so on.
Speaking of sums, you may remember that weve already discussed a formula
for 1 + + n (the triangular numbers):
1 2
1 + 2 + + n = (n + n).
2
But what if we consider sums of squares or cubes? Well, we also get similar
formulas:
 
1 3 1
1 2 + 2 2 + + n2 = n3 + n2 + n ,
3 2 2
1
1 3 + 2 3 + + n3 = n4 + 2n3 + n2 .

4
The general pattern seems to be that there are formulas that look like:
 
k1 k1 k1 1 k k1 1
1 +2 + + n = n + kn + ... ,
k 2
but the question remains, what patterns can we find in the coefficients on the
right-hand side? The answer was first studied by the 17th century mathemati-
cian Johann Faulhaber, and later given a more thorough treatment in the Ars
Conjectandi of the 18th century mathematician Jacob Bernoulli.
Faulhabers answer, as discussed by Bernoulli, says: Let
1 1 1
B 0 = 1, B1 = , B2 = , B4 = ,
2 6 30
1 1 5
B6 = , B8 = , B 10 = , ...
42 30 66
and let B 3 = B 5 = B 7 = = 0.9 Note that we write the terms in the sequence
B 0 , B 1 , B 2 , . . . as if they were powers, even though they arent, for reasons that
we hope will become clear in a moment.
9 Itis more standard to use the value B 1 = 12 , but our choice of + 21 is harmless, and
make certain formulas more aesthetically pleasing to our eyes; see footnote 10.

10
In any case, if we adopt this strange manner of writing the sequence of
Bernoulli numbers, then we get the following wonderful formula:
1
1k1 + + nk1 = (n + B)k B k .

k
In other words,
       
1 k k1 1 k k2 2 k
1k1 + + nk1 = nk + n B + n B + + n1 B k1
k 1 2 k1
   
1 1 k k2 1
= nk + knk1 + n + ... .
k 2 2 6

Note that we expand (n + B)k B k using the Binomial Theorem and our
strange way of writing terms from the sequence of Bernoulli numbers. For
example, taking k = 4, we get

(n + B)4 B 4 = n4 + 4n3 B 1 + 6n2 B 2 + 4nB 3 + B 4 B 4


1 1
= n4 + 4n3 + 6n2 + 4n 0
2 6
= n4 + 2n3 + n2 ,

which means that


1 4
1 3 + 2 3 + + n3 = (n + 2n3 + n2 ),
4
as we saw before.
The Bernoulli numbers have many other notable and important properties.
For example, they can be computed using the startling formula (B 1)k = B k
for k 2:

B 2 2B 1 + 1 = B 2 so we can solve for B 1 ,


B 3 3B 2 + 3B 1 1 = B 3 so we can solve for B 2 ,
B 4 4B 3 + 6B 2 4B 1 + 1 = B 4 so we can solve for B 3 ,

and so on.10 There is also the surprising fact, discovered by 19th century math-
ematicians Karl von Staudt and Thomas Clausen, that if 2, 3, . . . are all of the
primes p with the property that p 1 divides 2n, then
1 1 1
B 2n + + + + + ...
2 3 p
is an integer (in fact, it is equal to 1 for 2n 12).
Really, we could go on and write an entire separate article, or even a book,
about the Bernoulli numbers but well end our own little sequence here.
10 If we use the more standard B 1 = 12 , this formula becomes (B + 1)k = B k , but the
idea is the same.

11
8 Some Places Where You Can Learn More (Did
you notice the pattern in the titles of the sec-
tions of this article?)
This article is based on a lecture given by JHC at Santa Clara University in
March 2005. If you want to find out more about the sequences we have discussed
here, much of the material from this article and the lecture on which it based can
be found in The Book of Numbers, by JHC and Richard K. Guy [2]. Interested
Nerds should definitely continue their exploration of sequences there.
Another great resource of a different kind is the On-Line Encyclopedia of
Integer Sequences, or OEIS, which can be found at:
www.research.att.com/njas/sequences
The basic idea of this page is that if you enter the first few terms of a sequence,
the OEIS will return all of the sequences it can think of that contain those terms
at the beginning. (As a lower priority, the OEIS will also return sequences that
contain those terms somewhere after the beginning.) Try 3, 1, 4, 1, 5, 9, 2,
1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 6, 28, 496, or 14, 18, 23, 28, 34, 42. You can also
search sequences by keyword; try pi or divisor. The OEIS is designed to be
used by researchers in mathematics, so the entries tend to be quite condensed,
to the point of sometimes being a bit cryptic; however, most Nerds should be
able to get some enjoyment out of it. There are also a few places in the OEIS
that give more extensive descriptions; for example,
www.research.att.com/njas/sequences/classic.html
gives a very nice description of the Wythoff Array.
More advanced Nerds might also try looking at Ekhad and Zeilbergers proof
of the Cosmological Theorem [3] (code available from web page) and Calkin
and Wilfs description of the Stern sequence [1], both of which are available
online (see references). Finally, a truly adventurous (or college-level) Nerd with
access to both the Internet and a good college library might try looking at the
homepage of Clark Kimberling and the references contained therein:
http://faculty.evansville.edu/ck6/
Kimberling has written extensively on the Wythoff Array and related phenom-
ena, such as interspersions and fractal sequences. The scholarly college-level
Nerd might do well to start with the articles on interspersions by Kimberling
[6] and by Fraenkel and Kimberling [4].

References
[1] Neil Calkin and Herbert S. Wilf. Recounting the rationals. The American
Mathematical Monthly, 107:360363, 2000. or at:
http://www.cis.upenn.edu/wilf/website/recounting.pdf.

12
[2] John H. Conway and Richard K. Guy. The Book of Numbers. Coperni-
cus/Springer-Verlag, 1996.
[3] Shalosh B. Ekhad and Doron Zeilberger. Proof of Conways lost cosmo-
logical theorem. Electronic Research Announcements of the American
Mathematical Society, 3:7882, 1997. or at:
http://www.math.temple.edu/zeilberg/mamarim/mamarimhtml/horton.html.
[4] Aviezri Fraenkel and Clark Kimberling. Generalized Wythoff arrays, shuffles
and interspersions. Discrete Mathematics, 126:137149, 1994.
[5] Devin Kilminster. Primes in ten fractions. Unpublished; list of fractions can
be found by an Internet search for Kilminster primes ten fractions, 1999.
[6] Clark Kimberling. Interspersions and dispersions. Proceedings of the Amer-
ican Mathematical Society, 117:313321, 1993.
[7] David R. Morrison. A Stolarsky array of Wythoff pairs. In A Collection
of Manuscripts Related to the Fibonacci Sequence, pages 134136. Fibonacci
Association, Santa Clara, CA, 1980.

13

You might also like