You are on page 1of 3

recursive seq.

wxmx 1 / 3

礪 kill(all)
;
(%o0) done

礪 kill(all);
(%o0) done

礪 a[n]:=(2·a[n−1]);
'a[1]=a[1]:1;
(%o1) an := 2 an − 1
(%o2) a1 = 1

礪 a[2];
(%o3) 2

礪 a[4];
(%o4) 8

礪 pts:makelist([n,a[n]],n,1,5);
(%o8) [ [ 1 , 1 ] , [ 2 , 2 ] , [ 3 , 4 ] , [ 4 , 8 ] , [ 5 , 16 ] ]

礪 wxplot2d([discrete,pts],[style,points]);

(%t9)

(%o9)

礪 kill(all);
(%o0) done
recursive seq.wxmx 2 / 3

礪 a[n]:=a[n−1]+a[n−2];
'a[1]=a[1]:1;
'a[2]=a[2]:1;
(%o4) an := an − 1 + an − 2
(%o5) a1 = 1
(%o6) a2 = 1

礪 a[3];
(%o7) 2

礪 a[4];
(%o8) 3

礪 pts:makelist([n,a[n]],n,1,10);
(%o9) [ [ 1 , 1 ] , [ 2 , 1 ] , [ 3 , 2 ] , [ 4 , 3 ] , [ 5 , 5 ] , [ 6 , 8 ] , [ 7 , 13 ] ,
[ 8 , 21 ] , [ 9 , 34 ] , [ 10 , 55 ] ]

礪 wxplot2d([discrete,pts],[style, points]);

(%t10)

(%o10)

礪 kill(all);
(%o0) done
recursive seq.wxmx 3 / 3

礪 count:1;
x[n]:=(0.9)^(n);
for a:1 thru 1000 step 1 do
( if(abs(x[a])>= 0.001) then count:count+1);
print("The value of N is ", count+1);
(%o1) 1
n
(%o2) xn := 0.9
(%o3) done
The value of N is 67
(%o4) 67

礪 kill(all);
(%o0) done

礪 count:1;
x[n]:=(n)^(1/n);
l:limit(x[n],n,inf);
for a:1 thru 10000 step 1 do
( if(abs(x[a]−1)>= 0.001) then count:count+1);
print("The value of N is ", count+1);
(%o1) 1
1/n
(%o2) xn := n
(%o3) 1
(%o4) done
The value of N is 9124
(%o5) 9124

礪 kill(all)
;
(%o0) done

(%i4) count:1;
x[n]:=(2)^(n)/(n!);
for a:1 thru 1000 step 1 do
( if(abs(x[a])>= 0.001) then count:count+1);
print("The value of N is ", count+1);
(%o1) 1
n
2
(%o2) xn :=
n!
(%o3) done
The value of N is 11
(%o4) 11

You might also like