Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

MTHS120 - plotting sequences

Project: MTHS120
Views: 30
Kernel: SageMath (stable)

Plotting sequences

We plot the sequence an=cos(n)/na_n=\cos(n)/n for n=1,2,,100n=1,2,\dots,100.

p = points([(n,cos(n)/n) for n in range(1,101)]) show(p)
Image in a Jupyter notebook

We add the graphs of the functions given by f(x)=1/xf(x)=1/x and g(x)=1/xg(x)=-1/x to illustrate that from limx1/x=0\lim_{x\to\infty}1/x=0 we can deduce limnan=0\lim_{n\to\infty}a_n=0.

x = var('x') p += plot(1/x,x,1,100,color='red') + plot(-1/x,x,1,100,color='red') show(p)
Image in a Jupyter notebook