poslcass := proc (a, b, d) local i, j, s, e; s := 0; j := 0; for i from b to d
+b-1 do j := j+1; s := s+eval(subs(n = i,a)); lprint(evaln(s[j]) = s) end do;
e := sum(a,n = b .. n); lprint(evaln(s[n]) = e); Sum(a,n = b .. infinity) = 
limit(e,n = infinity) end proc;
sumplots := proc (rada) local term, n, a, b, psum, m, points, i, c, sn, p1, p2
; if nargs = 2 then c := args[2] else c := 0 end if; if typematch(rada,('Sum')
(term::algebraic,n::name = a::integer .. b::integer)) then psum := `@`(evalf,
unapply(Sum(term,n = a .. a+m-1),m)); points := [seq([[i, psum(i)+c], [i+1, 
psum(i)+c]],i = 1 .. b-a+1)]; points := map(op,points); p1 := PLOT(CURVES(
points),AXESLABELS(n,"s[n]")); sn := evalf(c+sum(term,n = a .. infinity)) else
ERROR("expecting a Sum structure as input") end if; if sn < infinity then p2 
:= plot(sn,n = a .. b,linestyle = 4); display({p1, p2}) else p1 end if end 
proc;
