This one weird thing that bugs me about summation and the like
Maybe https://en.wikipedia.org/wiki/Iterated_function#Some_formulas_for_fractional_iteration and https://en.wikipedia.org/wiki/Ramanujan_summation can bring some light, but i think it's easy find oneself lost in greater levels of abstraction, without good references or specific examples.
The abstraction you hint at is a standard example in Scheme or LISP programming. This is from page 64 of Abelson and Sussman's classic Structure and Interpretation of Computer Programs (http://web.mit.edu/alexmv/6.037/sicp.pdf):
Exercise 1.32.
Show that
sum
andproduct
(exercise 1.31) are both special cases of a still more general notion calledaccumulate
that combines a collection of terms, using some general accumulation function:(accumulate combiner null-value term a next b)
Accumulate
takes as arguments the same term and range specifications assum
andproduct
, together with acombiner
procedure (of two arguments) that specifies how the current term is to be combined with the accumulation of the preceding terms and anull-value
that specifies what base value to use when the terms run out. Writeaccumulate
and show howsum
andproduct
can both be defined as simple calls toaccumulate
.
This construction doesn't address any of your questions about convergence or integration. It can be further generalized to deal with potentially infinite streams of values to be combined, should you wish to pursue that.