#
**
Writing Number Patterns in Function Notation
**

Given a number pattern, or a sequence of numbers ${a}_{1},{a}_{2},{a}_{3},\dots ,{a}_{n},\dots $ we sometimes want to write the sequence in function notation, with the natural numbers are the domain of the function.

One of the simplest kinds of number pattern is the arithmetic sequence , in which each term differs from the previous term by a constant amount.

An arithmetic sequence with the first term ${a}_{1}$ and the common difference $d$ can be written in function notation as

$f\left(n\right)={a}_{1}+(n-1)d$

**
Example 1:
**

$0,-7,-14,-21,-28,\mathrm{...}$

This is an arithmetic sequence with the first term $0$ and a common difference of $-7$ .

$\begin{array}{l}f\left(n\right)=0+(n-1)(-7)\\ \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}=-7n+7\end{array}$

You can check, for example, that the function gives the correct value for the fourth term:

$\begin{array}{l}f\left(4\right)=-7\left(4\right)+7\\ =-28+7\\ =-21\end{array}$

**
Example 2:
**

$4,7,10,13,16,19,\dots $

This is an arithmetic sequence with the first term $4$ and a common difference of $3$ .

$\begin{array}{l}f\left(n\right)=4+(n-1)\left(3\right)\\ =4+3n-3\\ =3n+1\end{array}$

Another kind of number pattern is a geometric sequence , where each term is found by multiplying the previous term by a constant $r$ called the common ratio .

**
Example 3:
**

$\frac{1}{9},\frac{1}{3},1,3,9,27,81,\dots $

This is a geometric sequence with the first term $\frac{1}{9}$ and a common ratio of $3$ . It can be written in function notation as

$\begin{array}{l}f\left(n\right)={a}_{1}{r}^{n-1}\\ \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}=\left(\frac{1}{9}\right)\cdot {3}^{n-1}\end{array}$

Other more complicated sequences can also be written in function notation.