Question: Difference between seq and $ that explains a difference in evalf?

Hi,

While computing a simple sequence of numbers, I remarked a small difference between the result obtained with $ and with seq.

Digits:=20:
u:=proc(n) evalf(((n+1)/n)^(n+1)) end proc:
a:=[u(n)$n=1..10]:
b:=[seq(u(n),n=1..10)]:
a-b;

 

The result is:

 

[0., 0., -4.*10^(-19), 0., 0., 6.*10^(-19), -9.*10^(-19), 0., -3.*10^(-19), 0.]

I have no idea why there are nonzero values in the output. Does anyone have an explanation?

 

It seems I get the correct values if I quote the expression before $:

a:=['u(n)'$n=1..10]:

However, it's not clear to me why this makes a difference in evalf.

Please Wait...