---
author: Nathan Carter (ncarter@bentley.edu)
---

This answer assumes you have imported SymPy as follows.


```python
from sympy import *                   # load all math functions
init_printing( use_latex='mathjax' )  # use pretty math output
```

We will re-use the sequence defined in the task
how to define a mathematical sequence.


```python
var( 'n' )
a_n = 1 / ( n + 1 )
seq = sequence( a_n, (n,0,oo) )
seq
```




$\displaystyle \left[1, \frac{1}{2}, \frac{1}{3}, \frac{1}{4}, \ldots\right]$



We can graph any finite range of any sequence as follows.


```python
start = 0
stop = 10
import matplotlib.pyplot as plt
plt.plot( range(start,stop+1), seq[start:stop+1], '.' )
plt.show()
```

f264c992c3cccf3a58c1c72f2472b618cb98f94f
ipynb
Jupyter Notebook
database/tasks/How to graph mathematical sequences/Python, using SymPy and Matplotlib.ipynb
nathancarter/how2data
7d4f2838661f7ce98deb1b8081470cec5671b03a
MIT
database/tasks/How to graph mathematical sequences/Python, using SymPy and Matplotlib.ipynb
nathancarter/how2data
7d4f2838661f7ce98deb1b8081470cec5671b03a
MIT
database/tasks/How to graph mathematical sequences/Python, using SymPy and Matplotlib.ipynb
nathancarter/how2data
7d4f2838661f7ce98deb1b8081470cec5671b03a
MIT
2021-07-18T19:01:29.000Z
2022-03-29T06:47:11.000Z
Qwen/Qwen-72B
1. YES
2. YES

