Sequences
Notation:
Example:
Consider 1/2, 1/3, 1/4, 1/5,
, 1/10. Find a formula for the general term of this sequence.
Some solutions:
|
an |
= |
1/n, n = 2, 3, , 10 |
|
an |
= |
1/(n + 1), n = 1, 2, , 9 |
|
an |
= |
1/(n + 2), n = 0, 1, , 8 |
Operations with Sequences

Examples:

Sum of an Arithmetic Sequence:
.
Sum of a Geometric Sequence:
.
Multiplying by a constant or an expression
If C is a constant,

Product notation
The notation for the product of a sequence of numbers is analogous to the notation for their sum. The Greek capital letter pi,
![]()
Theorem 4.1.1 Properties of Summations and Products
Factorial Notation
The product of all consecutive integers up to a given integer occurs so often in mathematics that is given a special notation
Example: n! / (n -3)! = n(n -1)(n -2)(n -3)! / (n -3)! = n(n -1)(n -2).
Sequences in Computer Programming
An important data type in computer programming consists of finite sequences known as one-dimensional arrays. A single variable in which a sequence of variables may be stored: Say we name an array of k
Image objects "image", then image = image[0], image[1],
image[2]
image[k - 1].
Consider the following applet:
import java.awt.*;
import java.applet.*;
public class Clem extends Applet
{
private int NUM_IMAGES = 10;
private int MILLI_SECS = 250;
private Image image[ ] = new Image[NUM_IMAGES];
private int imageN = 0;
public void init()
{
for (int k = 0; k < image.length; k++) // Read each image into the array
image[k] = getImage(getDocumentBase(), "clem" + (k+1) + ".gif");
setBackground(Color.white);
setSize(440, 200);
} // init()
public void paint(Graphics g)
{
g.drawImage(image[imageN], 20, 20, this);
imageN = ++imageN % NUM_IMAGES;
delay();
repaint(); //recursive call to paint
} // paint()
private void delay()
{
try
{
Thread.sleep(MILLI_SECS);
}
catch (InterruptedException e)
{
System.out.println(e.toString());
}
} // delay()
} // Clem
Application: Converting from base 10 to base 2 using repeated division by 2.
The quotient-remainder theorem gives use an efficient algorithm for calculating base conversion: Divide the number to be converted (dividend) by the base (divisor) to get a quotient q[0] and remainder r[0]. Repeat this operation, divide q[0] by the base to get a quotient q[1] and remainder r[1]. Continue in this manner until q[k] = 0 and we have r[k]. In general, if a nonnegative integer n is repeatedly divided by 2 until a quotient of zero is obtained and the remainders are found to be r[0], r[1],
, r[k].
n = 2k
Example: Convert 25 to base 2.
