This is a linear feed back shift register, or LFSR. A Linear feedback shift register is, in normal computing, an integer of some size that is shifted over once per compute. Then, using the same exact positions in the binary representation of the number, which are called taps, the last shifted out bit is XOR'ed with the taps to produce the replacement value at bit 0. In most standard programming languages, you use more bitwise instructions, such as bitwise OR, bitwise AND, and bitwise XOR to implement this. The wikipedia page I have linked below gives an excellent example in the C programming language. However, in scratch we can use lists to provide us an even more expansive shift register. We could even have a shift register of 200 thousand bits! haha! The applications of this are covered in the LFSR wikipedia page I have linked below, but one I will share with you here is its uses in cryptography. Since it's very easy to build and provides decently random values, it is frequently used. Now, of course cryptography has grown beyond this, and in fact there is an algorithm, which, given a known unencrypted data and the actual encrypted data, that can find the smallest possible LFSR by taking advantage of it's linear nature. But, by complicating it a little bit and using methods such as a non-linear combination of several output bits, the problem is lessened, but not by too much. Preconditions: The starting "seed" if you will must be a NON-ZERO value. In this case our seed is randomly generated. Necessary Preconditions for MAXIMUM EFFICIENCY: The tap indexes must correspond to a polynomial that is primitive over the Galois field GF(2). The taps are all coprime
https://en.wikipedia.org/wiki/Linear-feedback_shift_register Main article. https://en.wikipedia.org/wiki/Finite_field A galois field is just a field with a finite number of things in it. A field is just a set where the four basic operations are defined, not given and follow basic rules and structure. Two numbers are coprime if both of their only positive divisor is one.