A fast algorithm for determining the complexity of a binary sequence with period 2n

The complexity of a periodic sequence (s) is defined to be the least number of stages in a linear feedback shift register that generates (s) .