GosperSummationMethod(E, V, R, P, Q)¶
sum.spad line 53 [edit on github]
V: OrderedSet
P: PolynomialCategory(R, E, V)
Q: Join(RetractableTo Fraction Integer, Field) with
coerce: P -> %
denom: % -> P
numer: % -> P
Gosper's
summation algorithm.
- GospersMethod: (Q, V, () -> V) -> Union(Q, failed)
GospersMethod(b, n, new)
returns a rational functionrf(n)
such thata(n) * rf(n)
is the indefinite sum ofa(n)
with respect to upward difference onn
, i.e.a(n+1) * rf(n+1) - a(n) * rf(n) = a(n)
, whereb(n) = a(n)/a(n-1)
is a rational function. Returns “failed” if no such rational functionrf(n)
exists. Note:new
is a nullary function returning a newV
every time. The condition ona(n)
is thata(n)/a(n-1)
is a rational function ofn
.