This site is supported by donations to The OEIS Foundation.
Zeckendorf representation
The Zeckendorf representation of an integer is the unique way of representing that integer as a sum of non-consecutive Fibonacci numbers. For example, the Zeckendorf representation of 12 is 10101, corresponding to 8 + 3 + 1.
- Theorem Z0. Every positive integer has a Zeckendorf representation as a sum of non-consecutive Fibonacci numbers .
- Proof. If an integer , where refers to the th Fibonacci number, then and for all , where is an array of binary digits and is the index of the most significant digit.
- Otherwise, we assign where is the largest Fibonacci number such that . Then . It is obvious that , because it can be safely assumed at this juncture that and are distinct, that and therefore . This proves that must be 1, but no more than that. If is a Fibonacci number, we can stop now, otherwise, we must again subtract the largest possible Fibonacci number, decrement accordingly and set the appropriate . The farthest this iterative process can go is to , corresponding to .
- Furthermore, the 1s in must have 0s in between them because any two consecutive 1s, such as at, say, and would indicate a failure to recognize that , and thus and can be set to zero in favor of setting to 1. □
- Corollary to Theorem Z0. No binary representation of a Mersenne number should be mistaken for a Zeckendorf representation; in other words, there are no repunits in Zeckendorf representations.
- Theorem Z1. For any positive integer , the Zeckendorf representation (with elements all 0s or 1s) of is unique.
For our proof, we accept it as axiomatic that but is not used in the Zeckendorf representation of any number. We also accept as axiomatic that all are distinct as long as .
- Proof. Assume that there are two integers and such that , yet they both have the same Zeckendorf representation with elements all 0s or 1s. We compute where is the th Fibonacci number. We can be assured that there is only one possible value for since all are distinct for and each was added only once or not at all, since each is limited by definition to 0 or 1. Now holds the value of the Zeckendorf representation . If , it follows that , but that would mean that is not the Zeckendorf representation of after all, hence this results in a contradiction of our initial assumption. And if on the other hand and , then this leads to a similar contradiction as to what is the Zeckendorf representation of really is. □
These facts may also be proven combinatorially.
- Theorem ZC. Every nonnegative integer has a unique representation as a sum of nonconsecutive Fibonacci numbers, where we do not use and instead use
- (Ignoring is necessary only to prevent the trivial counterexamples such as ).
- Proof. Given a sum where , we write that as a sequence of binary digits; thus is written as 101, while is 101001. Arrange such sequences with no two consecutive 1's (i.e. those sequences corresponding to sums of nonconsecutive Fibonacci numbers) in increasing lexicographic order starting from 0, and assign each one a rank corresponding to its order in the list:
- Note that the rank is not the value of the string as a binary string. In fact, it is the sum of the string when interpreted as a sum of Fibonacci numbers, but we do not assume this; as far as we know up to this point, all the rank is is the row number in this table.
- We say that such a sequence has length if the leftmost 1 is in position ; thus 100 has length 3.
- Claim that the number of representations with length is . We prove this by induction on ; note that it is true for and for . Now, given any representation of length , it either has length or it has length exactly . The number of representations of length is, by induction, . To compute the number of representations of length exactly , note that any such representation starts with 10 since we cannot have two consecutive 1's. The digits after the 10 are arbitrary as long as there are not two consecutive 1's, so that the number of such representations is precisely the number of representations of length , or . Thus the number of representations of length is . This proves the claim.
- We will now prove the theorem by counting the number of rows preceding row in two different ways. First, the number of such rows is obviously (since we just numbered the row consecutively). We now count the number of predecessors by looking at the corresponding sequence. Given a sequence , each of its predecessors first differs from it in some position ; since lexicographically, must be 1 in that position while is zero. Since has a zero in position , the remaining digits of are arbitrary subject to the consecutivity condition, so the number of possibilities for is the number of representations of length , which is . We can do this for each possible point of difference with (which occur at the positions in which has a 1, and thus must have nonconsecutive indices). This counts each predecessor of once and only once, and gives a representation of the number of predecessors as a sum of nonconsecutive Fibonacci numbers. But there are predecessors, so we have written as the required sum.
- As an example of this process, consider the row numbered 7, which is the sequence 1010. If a predecessor differs from it at the first 1, it is of the form 0*** where the asterisks are arbitrary (so long as there are no two consecutive 1's, so there are of them. If a predecessor differs from it at the second 1, it is of the form 100* and again the asterisks are arbitrary, so there are of them. Thus .
- This argument shows existence; uniqueness follows as well from this construction since every possible sum is represented in the list, and each one represents a different integer. □
These facts about Zeckendorf representations can be used to prove some facts about Fibonacci numbers.
- Theorem ZF. (John W. Layman) A positive integer has exactly two representations as the sum of two Fibonacci numbers if and only if is twice a Fibonacci number and . (See A078642).
- Proof. (Max Alekseyev) Suppose that the number has exactly two representations as the sum of two Fibonacci numbers. There are three types of representations possible:
- (I) The sum of two equal Fibonacci numbers
- (II) The sum of two consecutive Fibonacci numbers
- (III) The sum of two distinct non-consecutive Fibonacci numbers
- The two representations of must be of different types. Two representations of both of type (I) are not possible as is a strictly increasing function for . Similarly, two representations of m both of type (II) are not possible as is a strictly increasing function for . Finally, two representations of both of type (III) are not possible as that would violate the property of the Zeckendorf representation (the uniqueness of representation of all nonnegative integers).
- Consider all possible pairs of representation types:
- (I) and (II) are possible only for : but has more than two different representations.
- (II) and (III) are not possible together as that would again violate the property of the Zeckendorf numeral system.
- Finally, (I) and (III) gives rise to the sequence of . □
This article is based in part on the following PlanetMath articles http://planetmath.org/proofthateverypositiveintegerhasazeckendorfrepresentation and http://planetmath.org/proofthatazeckendorfrepresentationrepresentsauniquepositiveinteger and http://planetmath.org/combinatorialproofofzeckendorfstheorem