3.7.37. Border

A constraint that can be related to the notion of border, which we define now. Given a sequence s=urv, r is a prefix of s when u is empty, r is a suffix of s when v is empty, r is a proper factor of s when rs. A border of a non-empty sequence s is a proper factor of s, which is both a prefix and a suffix of s. We have that the smallest period of a sequence s is equal to the size of s minus the length of the longest border of s.