166 SCW, 11.1: Examples of Sequences
166 SCW, 11.1: Examples of Sequences
Example1(a):an=1-1n
Example1(a):=1-
a
n
1
n
In[]:=
a[n_]:=1-1/n
In[]:=
t1[n_]:=Table[a[i],{i,1,n}]
t1[20]
Out[]=
0,,,,,,,,,,,,,,,,,,,
1
2
2
3
3
4
4
5
5
6
6
7
7
8
8
9
9
10
10
11
11
12
12
13
13
14
14
15
15
16
16
17
17
18
18
19
19
20
Manipulate[Show[ListPlot[t1[m],PlotRange->{{0,20.1},{-0.1,2}}],Plot[1,{x,1,20},PlotStyle->Red,PlotRange->{{0,20.1},{-0.1,2}}]],{m,1,20,1},ControlPlacement->Top]
Out[]=
Example1(b):bn=1+n(-1)n:
Example1(b):=1+:
b
n
n
(-1)
n
In[]:=
b[n_]:=1+((-1)^n)*(1/n)
In[]:=
t1b[n_]:=Table[b[i],{i,1,n}]
t1b[20]
Out[]=
0,,,,,,,,,,,,,,,,,,,
3
2
2
3
5
4
4
5
7
6
6
7
9
8
8
9
11
10
10
11
13
12
12
13
15
14
14
15
17
16
16
17
19
18
18
19
21
20
Manipulate[Show[ListPlot[t1b[m],PlotRange->{{0,20.1},{-0.1,2}}],Plot[1,{x,1,20},PlotStyle->Red,PlotRange->{{0,20.1},{-0.1,2}}]],{m,1,20,1},ControlPlacement->Top]
Out[]=
Example1(c):cn=n(-1):
Example1(c):=:
c
n
n
(-1)
In[]:=
c[n_]:=(-1)^n
In[]:=
t1c[n_]:=Table[c[i],{i,1,n}]
t1c[20]
Out[]=
{-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1}
Manipulate[Show[ListPlot[t1c[m],PlotRange->{{0,20.1},{-2,2}}],Plot[{1,-1},{x,1,20},PlotStyle->{Red,Green},PlotRange->{{0,20.1},{-2,2}}]],{m,1,20,1},ControlPlacement->Top]
Out[]=
Example1(d):dn=.99:
Example1(d):=.99:
d
n
In[]:=
d[n_]:=.99
In[]:=
t1d[n_]:=Table[d[i],{i,1,n}]
t1d[20]
Out[]=
{0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99,0.99}
Manipulate[Show[ListPlot[t1d[m],PlotRange->{{0,20.1},{-0.1,2}}],Plot[0.99,{x,1,20},PlotStyle->Red,PlotRange->{{0,20.1},{-0.1,2}}]],{m,1,20,1},ControlPlacement->Top]
Out[]=

