Let's assume that there is a finite, continuous sequence, where the elements' value is a function of their index, i.e.:
an = f(n) where f is an arbitrary function
Is there a known such sequence where by applying a simple aggregate function (precisely sum, average, max, min) to the elements we can tell whether there is at least one item missing between the first and last element, and calculate which element it was (or even, which elements they were)?
E.g. is there a way to tell that "a1, a2, a4" misses a3 by only using the above, simple functions?
The actual problem is that I have a set of rows in an relational database table where independently running worker processes can issue inserts to. The rows represent batches of work, where each batch is part of the same set of work items. E.g.:
- Batch 1: items 1-10
- Batch 2: items 11-20
- Batch 3: items 21-30
I'd like to be able check in the table whether all batches were done (i.e. all items processed) or there are batches missing (e.g. items 10-19 were not processed for some reason). Calculating e.g. the sum of a column of all rows in a database table is a simple and fast operation.
I'm a software developer who learned maths in his native language, not English, so forgive me if my terminology is inaccurate. Thank you in advance.
The reason I'm looking for an approach different than something that just iterates over the items is that the number of batches can be potentially very big. Similarly it's not possible to use an approach that would create database rows for each batch at once (what would potentially mean creating thousands of rows e.g. when starting the work).