Question: How to force the evaluation of a function ?

Hello everybody, 

I use Maple to obtain the solution of a reccurrence equation :
r := rsolve({u(n)=n*(u(n-1)+1), u(0)=0}, u)

Now I want to define a function s(n) wich returns the integer value of the nth term u(n).
In the attached file three different attempts to compute the numerical value of s(2) (you can replace "2" by any other positive integer) are given.

  • S := unapply(r, n);
     
  • S := unapply(convert(r, sum), n);
     
  • S := unapply(simplify(convert(r, sum)), n);


But none of them returns an integer and I'm always forced to apply some operation to "transform" the output into the desired integer.
Could you please help me to understand why it is so ?

Thanks in advance

2018.mw

 

Please Wait...