Question: Plot seems to draw wrong graph

In maple 16 I do the following.

rsolve({a(1) = 1+2/n, a(p) = 1+(p-1)*a(p-1)/n+2*b(p-1)/n, b(0) = 1, b(p) = 1+p*b(p-1)/n}, {a(p), b(p)});

subs(p = n-1, %);

I then copy the answer for a(n-1) and evaluate it at n=20, say.

evalf(subs(n = 20, (1/n)^(n-1)*n*GAMMA(n-1)*(Sum((n+2*(1/n)^p1*exp(n)*GAMMA(p1+1, n))/(n^2*(1/n)^(p1+1)*GAMMA(p1+1)), p1 = 1 .. n-2)+1+2/n)));

which gives

6.067606450

 

But if I plot a(n-1) with

plot((1/n)^(n-1)*n*GAMMA(n-1)*(Sum((n+2*(1/n)^p1*exp(n)*GAMMA(p1+1, n))/(n^2*(1/n)^(p1+1)*GAMMA(p1+1)), p1 = 1 .. n-2)+1+2/n), n = 2 .. 20);

 

I get a completely different graph with the values 2..3 on the x-axis which decreases to around 0.5.

 

How can I get maple to plot a(n-1) properly?

 

 

 

 

 

Please Wait...