Complete sequence


In mathematics, a sequence of natural numbers is called a complete sequence if every positive integer can be expressed as a sum of values in the sequence, using each value at most once.
For example, the sequence of powers of two, the basis of the binary numeral system, is a complete sequence; given any natural number, we can choose the values corresponding to the 1 bits in its binary representation and sum them to obtain that number. This sequence is minimal, since no value can be removed from it without making some natural numbers impossible to represent. Simple examples of sequences that are not complete include the even numbers, since adding even numbers produces only even numbers—no odd number can be formed.

Conditions for completeness

Without loss of generality, assume the sequence an is in non-decreasing order, and define the partial sums of an as:
Then the conditions
are both necessary and sufficient for an to be a complete sequence.
A corollary to the above states that
are sufficient for an to be a complete sequence.
However there are complete sequences that do not satisfy this corollary, for example, consisting of the number 1 and the first prime after each power of 2.

Other complete sequences

Below is a list of the better-known complete sequences.
Just as the powers of two form a complete sequence due to the binary numeral system, in fact any complete sequence can be used to encode integers as bit strings. The rightmost bit position is assigned to the first, smallest member of the sequence; the next rightmost to the next member; and so on. Bits set to 1 are included in the sum. These representations may not be unique.

Fibonacci coding

For example, in the Fibonacci arithmetic system, based on the Fibonacci sequence, the number 17 can be encoded in six different ways:
In this numeral system, any substring "100" can be replaced by "011" and vice versa due to the definition of the Fibonacci numbers. Continual application of these rules will translate form the maximal to the minimal, and vice versa. The fact that any number can be represented with a terminal 0 means that it is always possible to add 1, and given that, for 1 and 2 can be represented in Fibonacci coding, completeness follows by induction.

Other coding systems

Other coding systems can be similarly devised. As with the Fibonacci sequence above, these coding systems that employ complete sequences will need to deal with multiple encoding solutions. The two main methods used are the greedy algorithm that will attempt to minimize the number of terms needed to encode an integer from the complete sequence and a minimizing algorithm that will attempt to maximize the number of terms needed to encode the same integer.