Britannica Sources used in this answer

How can a recurrence relation count subsets containing no consecutive integers?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

To determine the number of subsets of the set of the first n positive integers (Xn) that contain no two consecutive integers, we define this count as fn.

A subset of this type is formed in one of two mutually exclusive ways:
* It is a valid subset of Xn−1, which accounts for all valid subsets that do not include the integer n.
* It is formed by adjoining the integer n to a valid subset of Xn−2, which ensures that n−1 is not included, thereby maintaining the condition of no consecutive integers.

This logic leads to the recurrence relation:
fn=fn−1+fn−2

With the initial values f0=1 (the null set) and f1=2 (the null set and the set {1}), this relation generates the sequence f2=3, f3=5, f4=8, and so on. This approach allows for the calculation of the total count for any n using generating functions or iterative computation.1