 A linear feedback shift register is a special type of recurrence relation where the preceding terms are not raised to powers, that's where the linear comes from, and there are no added constants. Mathematicians would say that these are homogeneous recurrence relations. For example, a recurrence sequence where every term is dependent on the term before plus one is not a LFSR because of the added constant. Meanwhile, a recurrence relationship which is based on the preceding term plus the fourth term before plus the fifth term before is a LFSR because the preceding terms are not raised to powers and there are no added constants. And because this does depend on the fifth term before it, we would say this is a fifth order recurrence relation, at least if we're a mathematician. If we're a computer scientist, we would refer to the order as the number of registers. So this would be a five register LFSR. Because there's no added constant, a seed value of all zeros will produce nothing but zeros. Conversely, if the registers ever fill with all zeros, the output will always be zeros ever after. And because of this, we will only consider LFSRs that never produce a sequence of zeros. And what this means, if our output consists of ones and zeros, then the period of an LFSR with k registers is at most 2 to power k minus one. And that minus one is because of the sequence that we can never get. For example, let's take our LFSR as Sn, congruent to the sum of the two preceding values, mod two. And let's find the first few terms of the sequence starting with seed values of one and one. So we can write down the first two terms, S zero is one, and S one is one. S two is going to be the sum of the two preceding values, one and one, which will give us zero, mod two. S three will be the sum of the two preceding values, one and zero, which will be one mod two. S four will be the sum of the two preceding values, zero plus one, or one. S five will be the sum of the two preceding values, one plus one, or zero. And at this point, it's worth noting that to compute S five, we had to use the values one and one, which were the same as our initial seed values. And so starting with S five, we're just going to repeat all of our values. So we'll get zero, one, one, zero, and so on. Or let's take this LFSR. So we can set up our coefficients and input our seed one, one, one, one, and compute the next few terms. And if we do that, we get the sequence. And notice that at this point, we're back to our starting seed value, all ones. And so that means the recurrent sequence will just repeat itself after this. And because of that, we no longer need to compute further terms in our sequence. Now since the sequence goes through 15 terms before it repeats, and the maximum possible period for a fourth-order recurrence relationship is two to the fourth minus one, which is 15, this recurrence relationship gives us the longest possible period. And on a final note, if we only needed a string of ones and zeros for avernum cipher, we can stop here. If we want to convert these into an actual random or pseudo random number, then since we can get numbers from one through 15, we can take our bits forward at a time and convert them into a number between one and 15.