Skip to Content
MathematicsMathematics
  • Feature Paper
  • Article
  • Open Access

23 April 2026

12 Pages

The Cross-Joint Method and Generation of De Bruijn Sequences

,
and
Department of Cryptology, Military Communication Institute, ul. Warszawska 22A, 05-130 Zegrze Południowe, Poland
*
Author to whom correspondence should be addressed.
†
All authors contributed equally to this work.

Abstract

This manuscript studies the construction of nonlinear feedback shift registers that generate binary de Bruijn sequences by means of the cross-join pairs method. We explicitly state the original contribution of our study as follows: We combine the classical theorem of Mykkeltveit and Szmidt with constructive algorithms, implementation details for small orders, and an interpretation in terms of Fryers’ polynomials. We also clarify the relation to earlier methods, discuss computational complexity and practical limitations, formalize the definition of the weighted adjacency matrix, and expand the conclusion with applications and directions for future work. Numerical results for small orders demonstrate the feasibility of the approach.
MSC:
05-08

1. Introduction

This work concerns the study and construction of de Bruijn sequences. They were first discovered in the late nineteenth century by C. F. Sanite-Marie [1], who established a theorem on their enumeration. They were later independently rediscovered by N. de Bruijn [2] in the 1940s, together with an independent proof of the theorem on their number. Since then, numerous works have investigated the construction of de Bruijn sequences and their connections with Nonlinear Feedback Shift Registers (NLFSRs), including, among others, our own works [3,4,5,6].
D. Coppersmith et al. in [7] derived an analytic formula for the generating function describing the perturbation process of sequences generated by linear recurrences. To a certain extent, their formula also describes the perturbation of sequences generated by nonlinear recurrences. The resulting Fryers’ polynomial quantitatively describes the process of applying cycle joining and the cross-join method in order to generate all de Bruijn sequences of a given order. Several illustrative examples are presented in Section 4. We extend the calculations given in [7] in an explicitly algorithmic direction. More precisely, we present constructive procedures for generating de Bruijn sequences through the repeated use of cross-join pairs, implement them for small orders, and discuss both their scope and their computational limitations. This constitutes the original contribution of this paper and distinguishes it from a purely historical review.
To some extent, their formula also describes the perturbation of sequences generated by nonlinear recurrences. The resulting Fryers’ polynomial provides a quantitative description of the process of applying cycle joining and the cross-join method to generate all de Bruijn sequences of the given order. Numerous examples are provided in Section 4.
We extend the calculations given in [7]. We present some algorithms that enable the generation of all de Bruijn sequences and implement them for small orders.

2. Nonlinear Feedback Shift Registers and De Bruijn Sequences

Let F 2 = { 0 , 1 } be a binary field and F 2 n an n-dimensional vector space over this field. Elements of the F 2 n space are n-vectors ( a 0 , … , a n − 1 ) .
Definition 1.
A de Bruijn sequence of order n is a 2 n -long binary cyclic sequence, where each subsequence of n consecutive elements occurs exactly once.
C. F. Sainte-Marie and N. G. de Bruijn [1,2] proved that the number of cyclically non-equivalent de Bruijn sequences of order n amounts to
B n = 2 2 n − 1 − n .
Definition 2.
A modified n-order de Bruijn sequence is a 2 n − 1 long binary cyclic sequence obtained from an n-order de Bruijn sequence by deleting one zero from the run of n consecutive zeros.
There is one-to-one correspondence between n-order de Bruijn sequences and modified de Bruijn sequences of the same order. Cryptography often uses modified de Bruijn sequences in order to avoid a zero initialization vector.
Definition 3.
A Boolean function of n variables is the following binary-valued function:
f : F 2 n ⟶ F 2 ,
where function arguments will be indexed as x 0 , … , x n − 1 .
The Boolean functions are usually represented in the form of truth table, which is a one-dimensional table of length 2 n containing ordered function values
[ f ( X 0 ) , … , f ( X 2 n − 1 ) ] ,
where the integers X i run over the interval [ 0 , … , 2 n − 1 ] and are in binary form. It can be proved that an equivalent representation of a Boolean function is the so-called Algebraic Normal Form (ANF), where the function f is represented as a polynomial of n Boolean variables:
f ( x 0 , x 1 , … , x n − 1 ) = ∑ a i 1 , … , i t x i 1 ⋯ x i t , a i 1 , … , i t ∈ F 2 ,
Here, the sum is over all t-subsets { i 1 , … , i t } ⊂ { 0 , 1 , … , n − 1 } . In the sum (2), we identify the powers x i k = x i . If  F 2 [ x 0 , … , x n − 1 ] is a polynomial ring of n Boolean variables, while the ideal I = { x i k = x i , i = 0 , … , n − 1 , k ∈ N } , then the Boolean functions in the algebraic normal form are elements of the quotient ring F 2 [ x 0 , … , x n − 1 ] / I .
Definition 4.
A Feedback Shift Register (FSR) (see Figure 1) of order n is the transformation F : F 2 n → F 2 n in the following form:
F : ( x 0 , x 1 , … , x n − 1 ) ↦ ( x 1 , x 2 , … , x n − 1 , f ( x 0 , x 1 , … , x n − 1 ) ) ,
where the feedback function f is a Boolean function of n variables.
Figure 1. An n-bit FSR.
The FSR is called non-singular if the transformation F is a bijection of the space F 2 n . It was proved in [8,9] that the necessary and sufficient condition of the non-singularity is the following form of a feedback function:
f ( x 0 , x 1 , … , x n − 1 ) = x 0 + F ( x 1 , … , x n − 1 ) ,
where F is a Boolean function of n − 1 variables.
The non-singularity of the register implies that F in (3) decomposes the space F 2 n into disjoint cycles. When there is only one cycle, the register generates a de Bruijn sequence.
Theorem 1
([8]). Let ( s t ) be an n-order de Bruijn sequence. Then, there is a Boolean function F ( x 1 , … , x n − 1 ) such that
s t + n = s t + F ( s t + 1 , … , s t + n − 1 ) , t = 0 , 1 , … , 2 n − n − 1 .
This means that de Bruijn sequences are generated by certain recurrences. The number of all possible Boolean functions of n − 1 variables in Equation (4) amounts to 2 2 n − 1 . The comparison with (1) for the number of all n-order de Bruijn sequences leads us to the conclusion that the probability of randomly hitting the Boolean function in the form of (4) generating de Bruijn sequence is 2 − n . Because of the algebraic normal form, the register feedback Boolean functions can be linear,
f ( x 0 , x 1 , … , x n − 1 ) = x 0 + c 1 x 1 + … + c n − 1 x n − 1 ,
where c 1 , … , c n − 1 ∈ F 2 , or nonlinear, containing higher-algebraic-degree monomials.
Theorem 2.
Linear recurrence (5) generates a binary sequence with a maximum period 2 n − 1 if and only if the polynomial
p ( x ) = x n + c n − 1 x n − 1 + … + c 1 x + 1
is a primitive polynomial, i.e., its roots are the generators of multiplicative group G F ( 2 n ) * of finite field G F ( 2 n ) constructed from polynomial (6). These sequences are called m-sequences (see R. Lidl and H. Niederreiter [10] for the corresponding definitions).
Let us denote a state of a non-singular n-order FSR by u = ( x 0 , x 1 , … , x n − 1 ) . The state u ^ = ( x ¯ 0 , x 1 , … , x n − 1 ) , where x ¯ 0 = x 0 + 1 , is called the conjugate state to the state u. Let us assume that the register states in question occur in one cycle.
Definition 5.
Two pairs of conjugate states of the FSR determined by the feedback function f are
α = ( a 0 , a 1 , … , a n − 1 ) , α ^ = ( a ¯ 0 , a 1 , … , a n − 1 ) ,
β = ( b 0 , b 1 , … , b n − 1 ) , β ^ = ( b ¯ 0 , b 1 , … , b n − 1 ) ,
which constitute a cross-join pair for the sequence ( a t ) generated by the FSR if the states occur in the order α , β , α ^ , β ^ during the generation of the sequence.
With an m-sequence generated by linear recurrence f in the form of (5) and a cross-join pair of states for the m-sequence given by u = ( a 0 , a 1 , … , a n − 1 ) , v = ( b 0 , b 1 , … , b n − 1 ) , we can create the following nonlinear feedback function:
Definition 6.
Let f be the feedback function of an m-sequence and let u = ( a 0 , a 1 , … , a n − 1 ) and v = ( b 0 , b 1 , … , b n − 1 ) determine a cross-join pair. We define the associated cross-join transformation by
f 1 ( x 0 , x 1 , … , x n − 1 ) = f ( x 0 , x 1 , … , x n − 1 ) + ( x 1 + a 1 + 1 ) … ( x n − 1 + a n − 1 + 1 ) + ( x 1 + b 1 + 1 ) … ( x n − 1 + b n − 1 + 1 ) ,
which generates a modified n-order de Bruijn sequence.
The above construction is referred to as an operation (or a method) of a cross-join pair. This operation can also be used for de Bruijn sequences. Constructing the feedback function for registers with a maximum period using cross-join pairs is a basic method for obtaining new nonlinear shift registers. It is described in the monograph by S. Golomb [8] published in 1967 and in [11].

3. The Theorem About Generating De Bruijn Sequences

Theorem 3
([4]). For two de Bruijn sequences u t and v t , the sequence v t can be obtained from u t through the repeated application of the cross-join pair operation.
The proof of this theorem is given in [4]. As an immediate consequence of Theorem 3, we also have the following:
Lemma 1.
For every de Bruijn sequence, and for every modified de Bruijn sequence of the same order, there exists at least one cross-join pair.
According to Helleseth and Kløve [11], we have Formula (7) for the number of different cross-join pairs for an m-sequence of order n:
( 2 n − 1 − 1 ) ( 2 n − 1 − 2 ) 6 .
For modified de Bruijn sequences of order n generated by feedback functions of NLFSRs, we do not have explicit formulas for the number of cross-join pairs, but our experiments show that for small orders n = 4 , 5 , 6 , these numbers vary with NLFSRs of the given order and are around the value of (7). The ANF of the feedback function of a given de Bruijn sequence of order n is different from that of the corresponding modified de Bruijn sequence of the same order (obtained by removing one zero from the tuple of n consecutive zeros). If  f ( x 0 , x 1 , … , x n − 1 ) is a Boolean feedback function that generates a modified de Bruijn sequence of order n, then the Boolean feedback function of the corresponding de Bruijn sequence is equal to
f ( x 0 , x 1 , … , x n − 1 ) + x ¯ 1 x ¯ 2 ⋯ x ¯ n − 1 .
According to (8), after calculating
x ¯ 1 x ¯ 2 ⋯ x ¯ n − 1 = ( x 1 + 1 ) ( x 2 + 1 ) ⋯ ( x n − 1 + 1 ) ,
the Boolean feedback function that generates a de Bruijn sequence contains the term x 1 ⋯ x n − 1 ; it has algebraic degree n − 1 . We will also use formulas for the ANF of Boolean functions and the expressions that contain products of variables and their negations to abbreviate the notation.
Boolean feedback functions generating modified de Bruijn sequences of order n have an algebraic degree of at most n − 2 ; some of them have degree 1 (those corresponding to LFSRs generating m-sequences), and there are also functions of low degrees, n = 2 , 3, or 4, which have a small number of terms in their ANF. In [12], Gammel et al. found NLFSRs up to an order of n = 33 , algebraic degree up to 5, and containing up to around 30 terms in their ANF. According to Theorem 3, we know that such simple feedback functions of maximum-period NLFSRs can be obtained through the repeated application of the cross-join pair operation to a feedback function of an LFSR generating an m-sequence. The problem involves finding an effective algorithm to realize this task. The next section presents our efforts in this direction.

3.1. Applications

De Bruijn sequences and their nonlinear generators are relevant in stream cipher design, pseudorandom sequence generation, coding theory, and combinatorial testing. In this section, we focus on the constructive aspect: given a modified de Bruijn sequence and its corresponding NLFSR, we use cross-join operations to derive new maximum-period generators.
In this section, we consider modified de Bruijn sequences and feedback functions of NLFSRs generating these sequences. We use the cross-join pair operation to construct new NLFSRs from a given one. Let f ( x 0 , x 1 , … , x n − 1 ) be a feedback function generating a modified de Bruijn sequence. Let α , β , α ^ , β ^ be a cross-join pair for the sequence generated by the function f ( x 0 , x 1 , … , x n − 1 ) . We use the formula from Definition 6 to construct a feedback function of a new modified de Bruijn sequence. The existence of such pairs is guaranteed by Lemma 1. When we apply the cross-join pair operation several times to a maximum-period LFSR, the resulting higher-degree terms may cancel out and we obtain a feedback function with a simple ANF. In fact, we do not have strict control over the process of algebraic cancellation of terms resulting from cross-join pairs, and finding NLFSRs with a simple ANF is a random process.
We implemented such an Algorithm 1. It works for n = 4 and n = 5 , giving all corresponding feedback functions. For  n = 5 , we have B 5 = 2048 feedback functions altogether. The algorithm works for greater orders of n too. For  n = 6 , we have B 6 = 2 26 maximum-period NLFSRs and LFSRs. In our implementation of the algorithm, we used the SAGE package [13], especially the brial module implementing operations on algebraic normal forms of Boolean functions. All algorithms were implemented in the Python 2.7 programming language [14]. It takes about 15 min on a standard desktop computer to generate all modified de Bruijn NLFSRs of order 5. This experiment also illustrates the computational complexity of the approach: the number of candidate states and cross-join operations grows exponentially with order n, so exhaustive generation is practical only for small orders.
Algorithm 1 Generation of modified de Bruijn sequences through repeated cross-join operations
  • Input: an order n and a maximum-period LFSR of order n.
  • Output: a collector set C containing feedback functions of modified de Bruijn sequences obtained by the method.
1:
For a given n, we choose a maximum-period LFSR of order n.
2:
We find the set J of all cross-join pairs for the states generated by this LFSR.
3:
We calculate, using the cross-join pair method, all NLFSRs corresponding to elements of J . The feedback functions of these NLFSRs and that of the chosen LFSR are added to a collector set C .
4:
We choose an NLFSR from the set C and find a new set J of all cross-join pairs for this NLFSR.
5:
We calculate all NLFSRs for the new set J . We add the calculated NLFSRs to the set C , ensuring that only distinct functions are retained. In this way, a new set C is formed. It consists of different NLFSRs and LFSRs.
6:
Steps (4) and (5) are repeated until the collector C consists of all B n (see Formula (1)), different feedback functions of modified de Bruijn sequences of order n. It is necessary in practice to calculate more than B n feedback functions since some of them repeat during the collection process.
7:
Then, the process stops.

3.2. NLFSRs of Higher Order

We construct an NLFSR of order 7. We take the primitive polynomial p ( x ) = x 7 + x + 1 . The feedback function of the corresponding LFSR is x 0 + x 6 . We start from the initial state s 0 = ( x 0 , x 1 , … , x 6 ) = ( 1 , 0 , … , 0 ) and generate all non-zero states s 1 , … , s 126 of the LFSR. Let us consider the states for which x 2 = 1 and x 4 = 0 ; there are altogether 32. We can find eight cross-join pairs with no common states, which all cover the states with ( x 2 , x 4 ) = ( 1 , 0 ) . A list of those cross-join pairs ( α , α ^ ; β , β ^ ) follows:
( 10 , 29 ; 17 , 101 ) , ( 20 , 58 ; 21 , 91 ) , ( 25 , 47 ; 32 , 62 ) , ( 37 , 118 ; 113 , 125 ) ,
( 38 , 107 ; 71 , 119 ) , ( 42 , 55 ; 50 , 94 ) , ( 59 , 82 ; 81 , 90 ) , ( 65 , 97 ; 70 , 106 ) .
After the calculations, we obtain the feedback function
f = x 0 + x 2 + x 6 + x 2 x 4 ,
which is a feedback function of the NLFSR generating a modified de Bruijn sequence of period 2 7 − 1 = 127 . In [15], an NLFSR was found with a maximal period of the above form (with one quadratic term) up to an order of 32.
We formulate below some necessary conditions for applying the cross-join pair method to construct NLFSRs with a simple ANF that generates sequences of a maximal period of 2 n − 1 .
Then, conditions 1 and 2 of Algorithm 2 are necessary for the function (9) to generate a sequence with a maximum period of 2 n − 1 . An example of such a family of cross-join pairs is given above in Section 3.2. Conditions 1 and 2 are not sufficient to guarantee the maximum period. When they are satisfied, one must check the period of the sequence generated by function f .
Algorithm 2 Necessary conditions to construct NLFSRs with a simple ANF
  • Let us consider a candidate for a feedback function of an NLFSR with a maximum period of 2 n − 1 that has the form
    f ( x 0 , x 1 , ⋯ , x n − 1 ) = g ( x 0 , x 1 , ⋯ , x n − 1 ) + h ( x 1 , ⋯ , x n − 1 ) ,
    where g is a linear function corresponding to a primitive polynomial and h is a Boolean function of low algebraic degree (say up to 5) with the number of terms ranging from 10 to 20. The number of all terms in f must be even. In our construction, we need to know the set S of states ( x 0 , x 1 , ⋯ , x n − 1 ) for which h ( x 1 , ⋯ , x n − 1 ) = 1 , and the number of states in S must be a multiple of 4. Now, we find a set J of cross-join pairs for the m-sequence generated by the feedback function g, but only those whose states belong to S . Suppose the collection J of cross-join pairs has the following properties:
1:
All cross-join pairs in J are disjoint; they do not contain common states from S .
2:
All states in cross-join pairs of J exactly cover the set S .
The above consideration is an example of how one can construct, using the cross-join pair method, NLFSRs with a maximum period with a simple ANF. It is not a practically applicable algorithm. It has been pointed out by one of the referees of [4] that such an algorithm would have a much greater complexity than that of the brute force search for maximum period NLFSRs. Another promising method for constructing maximum-period NLFSRs is to join cycles of non-singular LFSRs; see e.g., [3,6,8,16,17,18,19,20,21,22]. The problem with this is having to control the algebraic degree and number of terms in the ANF of the constructed NLFSRs.

4. Perturbation of Linear and Nonlinear Recursions

In this section, we summarize the relevant results from [7] of D. Coppersmith, R. C. Rhoades, and J. M. VanderKam and combine them with our own calculations for small orders. This clarifies which statements are reproduced from the literature and which numerical illustrations were generated in our implementation.
Let S ( n ) be the set of functions F 2 n − 1 → F 2 in Equation (4) that generate de Bruijn sequences of order n. For  f : F 2 n − 1 → F 2 , define S ( f ; k ) to be the set of g ∈ S ( n ) such that the weight of f + g is k. In other words, the number of disagreements between the functions f and g is k. Moreover, let N ( f ; k ) = | S ( f ; k ) | and
G ( f ; y ) = ∑ k N ( f ; k ) y k .
Let a linear function l : F 2 n − 1 → F 2 generate a sequence of period 2 n − 1 without a run of n zeros. In [7], a formula is given according to Michael Fryers:
G ( l ; y ) = 1 2 n ( 1 + y ) 2 n − 1 − ( 1 − y ) 2 n − 1
which can be deduced from Theorem 1.1 of [7]. The formula of Helleseth and Kløve [11] for the number of cross-join pairs for de Bruijn sequences generated by a linear recursion can be deduced from (11), and one can also obtain its generalizations.
We derive a formula for N ( l ; k ) using the Maclaurin expansion of the function (10):
G ( l ; y ) = ∑ k = 1 ∞ a k y k , a k = 1 k ! G ( k ) ( l ; y ) ∣ ( y = 0 ) .
Hence, N ( l ; k ) = a k can be obtained by calculating the derivatives of G ( l ; y ) at y = 0 or through the direct calculation of (11) as a polynomial. We have the following:
  • N ( l ; 1 ) = 1 , which means that from an m-sequence, we obtain one de Bruijn sequence by adding the all-zero state, which makes one change in the truth table of function l.
  • N ( l ; 2 ) = 0 ; now, we change the truth table in two places. One introduces the zero cycle and the other splits the whole cycle into two cycles. In general, all N ( l ; k ) = 0 for even k, since we obtain some number of disjoint cycles.
  • N ( l ; 3 ) is the Helleseth and Kløve Formula (7) counting the number of cross-join pairs in an m-sequence or equivalently the number of two changes in the truth table (plus one for the zero cycle), which disjoin the cycle and then join them into one cycle. Hence, Fryers’ formula leads to an analytic proof of Formula (7).
  • The formula for N ( l , k ) , for odd 1 ≤ k ≤ 2 n − 1 − 1 , reads
    N ( l , k ) = 1 2 n − 1 2 n − 1 k for n ≥ 2 .
    which is a generalization of (7).
  • N ( l ; 2 n − 1 − 1 ) = 1 , which follows from calculations, means that at the last step of the process, we obtain only one de Bruijn sequence.
  • N ( l , k ) = 0 for k > 2 n − 1 − 1 , which means that no more de Bruijn sequences are produced.
  • We have that
    G ( l , 1 ) = ∑ k = 1 2 n − 1 − 1 N ( l , k ) = 2 2 n − 1 − n
    which is the number (1) of all cyclically non-equivalent de Bruijn sequences of order n .

4.1. The Special Cases

Let us consider the special cases of the equation for G ( l , 1 ) for small values of order n .
  • n = 4 : ∑ k = 1 7 N ( l , k ) = 1 + 7 + 7 + 1 = 16 .
  • n = 5 :
    ∑ k = 1 15 N ( l , k ) = 1 + 35 + 273 + 715 + 715 + 273 + 35 + 1 = 2048 .
    Here, 35 is the number of cross-join pairs for an m-sequence of order 5, 273 is the number of new de Bruijn sequences obtained after the second application of the cross-join method. Applying the cross-join method eight times produces all de Bruijn sequences.
  • n = 6 :
    ∑ k = 1 31 N ( l , k ) = 1 + 155 + 6293 + 105183 + 876525 + 4032015 + 10855425 + 17678835 + 17678835 + 10855425 + 4032015 + 876525 + 105183 + 6293 + 155 + 1 = 67108864 = 2 26 .
    Let us remark the symmetry in the appearing numbers.
We have confirmed experimentally the numbers appearing for n = 4 and n = 5 . They are consistent with Theorem 3, which states that for any two de Bruijn sequences of a given order, one can be obtained from the other through the repeated application of the cross-join pair method.
An implementation of the Algorithm 3 generates all feedback functions of modified de Bruijn sequences for the orders n = 4 and n = 5 and partly for n = 6 . For  n = 7 , it is not realistically feasible since there are 2 57 de Bruijn sequences of order 7 in total. One can try to run this algorithm for greater values of n and generate only some fraction of the NLFSRs.
Algorithm 3 Enumeration guided by Fryers’ polynomial coefficients
  • Input: an m-sequence of order n and its linear recursion l.
  • Output: distinct feedback functions of modified de Bruijn sequences produced in successive cross-join stages.
1:
Choose an m-sequence of given order n and the corresponding linear recursion l . Find all cross-join pairs for the corresponding modified de Bruijn sequence of the period 2 n − 1 . Construct all Boolean feedback functions for these cross-join pairs, N ( l , 3 ) for all of them.
2:
Find all cross-join pairs for the just constructed modified de Bruijn sequences and construct new feedback functions from these cross-join pairs. It happens that different cross-join pairs produce the same NLFSRs. Hence, we have to sieve the set of all NLFSRs obtained in the second application of the cross-join method to have only different feedback functions. There should be N ( l , 5 ) of them.
3:
We realize the next steps of the application of the cross-join pair method up to the last step where only one new NLFSR should appear. In this manner, all feedback functions of the modified de Bruijn sequences have to be generated.

4.2. Fryers’ Polynomials

Function (11) is an example of a Fryers’ polynomial associated with a linear recurrence generating an m-sequence. Such polynomials encode how many de Bruijn sequences are obtained after a given number of truth table changes. More generally, one may start from a linear or nonlinear recurrence and consider the corresponding polynomial description of the generation process. We quote the relevant result from [7] and adapt the notation to our setting.
Definition 7.
For any function f : F 2 n − 1 → F 2 , define the weighted adjacency matrix W f , n of size 2 n × 2 n as follows. Its rows and columns are indexed by the states of the shift register. If a state u = ( x 0 , x 1 , … , x n − 1 ) is followed by the state v = ( x 1 , x 2 , … , x n − 1 , x n ) with x n = x 0 + f ( x 1 , … , x n − 1 ) , then the entry corresponding to ( u , v ) is equal to 1; otherwise, it is equal to y.
For any function f : F 2 n − 1 → F 2 define the weighted adjacency matrix W f , n . It is the 2 n × 2 n matrix with 1 in the row and column corresponding to x n − 1 … x 1 x 0 → x n x n − 1 … x 1 if x n = x 0 + f ( x n − 1 , … , x 1 ) , and y otherwise.
Lemma 2.
We have that ( 1 + y ) 2 n − 1 − 1 · G ( f ; y ) is equal to the determinant of ( 1 + y ) · I 2 n − W f , n after deleting the first row and the first column.
We present an application of Lemma 2. We consider the pure circulating register of the order n = 4 given by the feedback function f ( x 0 , x 1 , x 2 , x 3 ) = x 0 . Then, the corresponding Fryers’ polynomial is
G ( f ; y ) = 12 y 5 + 4 y 7 ,
which can be interpreted as follows: after joining the cycles of f with 5 changes in the truth table, we obtain 12 new de Bruijn sequences, and after the second stage, we apply the cross-join pair method and obtain 4 new de Bruijn sequences. We have carried out similar calculations for all linear recurrences of order 4. The results are in shown Table 1. When starting from nonlinear modified de Bruijn sequences, we have two patterns of Fryers’ polynomials:
y + 7 y 3 + 7 y 5 + y 7 and y + 10 y 3 + 5 y 5
which we represent, respectively, as ( 1 , 7 , 7 , 1 ) and ( 1 , 10 , 5 , 0 ) .
Table 1. Linear recurrences of order n = 4.
For the pure circulating register of order 5, we have the corresponding Fryers’ polynomial:
576 y 7 + 960 y 9 + 448 y 11 + 64 y 13 .
The sum of coefficients
576 + 960 + 448 + 64 = 2048 = 2 11
is the total number of de Bruijn sequences of order 5, and 576 is the number of spanning trees for the adjacency graph of the pure circulating register.
F. Ezerman and A. Fahrenza from Singapore Nanyang Technological University have calculated the Fryers’ polynomials of all de Bruijn sequences of order 5. The representative patterns are summarized in Table 2.
Table 2. Last 30 of 60 distribution patterns for order 5.

5. Conclusions

In this paper, we clarified the original contribution of the work and strengthened both the exposition and practical interpretation of the results. The main purpose of this paper is to present a constructive and implementation-oriented perspective on the cross-join method, together with explicit small-order computations and a connection with Fryers’ polynomials. We also explained how the proposed algorithms differ from classical constructions based purely on linear recurrences: they operate directly on cross-join transformations and therefore provide a flexible way to construct nonlinear feedback shift registers that generate de Bruijn sequences. At the same time, the computational cost grows rapidly with the order, so the present implementation is mainly useful for small values of n. From the application point of view, the constructions are relevant to stream cipher design, pseudorandom sequence generation, and combinatorial sequence design. Future work should focus on improving scalability, analyzing the structure of cross-join graphs for larger orders, and developing more efficient heuristics for finding maximum-period NLFSRs with simple algebraic normal forms.

Author Contributions

Conceptualization, P.D., T.R. and J.S.; methodology, P.D., T.R. and J.S.; software, P.D., T.R. and J.S.; validation, P.D., T.R. and J.S.; formal analysis, P.D., T.R. and J.S.; investigation, P.D., T.R. and J.S.; resources, P.D., T.R. and J.S.; data curation, P.D., T.R. and J.S.; writing—original draft preparation, P.D., T.R. and J.S.; writing—review and editing, P.D., T.R. and J.S.; visualization, P.D., T.R. and J.S.; supervision, P.D., T.R. and J.S.; project administration, P.D., T.R. and J.S.; funding acquisition, P.D., T.R. and J.S. All authors have read and agreed to the published version of the manuscript.

Funding

The research of all authors was supported by the Military Communication Institute, Poland.

Data Availability Statement

No new data were created or analyzed in this study.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. de Bruijn, N.G. Acknowledgement of Priority to C. Flye Sainte-Marie on the Counting of Circular Arrangements of 2n Zeros and Ones that Show Each n-Letter Word Exactly Once; EUT Report, WSK; Department of Mathematics and Computing Science, Technische Hogeschool Eindhove: Eindhoven, The Netherlands, 1975; Volume 75-WSK-06. [Google Scholar]
  2. de Bruijn, N.G. A combinatorial problem. Indag. Math. 1946, 8, 461–476. [Google Scholar]
  3. Dabrowski, P.; Labuzek, G.; Rachwalik, T.; Szmidt, J. Searching for non-linear feedback shift registers with parallel computing. Inf. Process. Lett. 2014, 114, 268–272. [Google Scholar] [CrossRef] [Scilit]
  4. Mykkeltveit, J.; Szmidt, J. On cross joining de Bruijn sequences. Contemp. Math. 2015, 632, 335–346. [Google Scholar]
  5. Szmidt, J. Nonlinear feedback shift registers and zech’s logarithms. In International Conference on Military Communications and Information Systems; IEEE: New York, NY, USA, 2019; pp. 1–4. [Google Scholar]
  6. Szmidt, J.; Dąbrowski, P. The construction of nonlinear feedback shift registers of small orders. In Proceedings of the International Conference on Military Communications and Information Systems, Cracow, Poland, 18–19 May 2015. [Google Scholar] [CrossRef] [Scilit]
  7. Coppersmith, D.; Rhoades, R.C.; VanderKam, J.M. Counting De Bruijn sequences as perturbations of linear recursions. arXiv 2017, arXiv:1705.07835. [Google Scholar] [CrossRef] [Scilit]
  8. Golomb, S. Shift Register Sequences; Welch, L.R., Goldstein, R.M., Hales, A.W., Eds.; Holden-Day: San Francisco, CA, USA, 1967. [Google Scholar]
  9. Walker, E.A. Non-Linear Recursive Sequences. Can. J. Math. 1959, 11, 370–378. [Google Scholar] [CrossRef] [Scilit]
  10. Lidl, R.; Niederreiter, H. Finite Fields; Cambridge University Press: Cambridge, UK, 1997. [Google Scholar]
  11. Helleseth, T.; Kløve, T. The number of cross-join pairs in maximum length linear sequences. IEEE Trans. Inf. Theory 1991, 37, 1731–1733. [Google Scholar] [CrossRef] [Scilit]
  12. Gammel, B.M.; Göttfert, R.; Kniffler, O. ACHTERBAHN-128/80, ECRYPT Stream Cipher Project Report. 30 June 2006. Available online: https://www.matpack.de/achterbahn/Gammel_Goettfert_Kniffler_Achterbahn-128-80.pdf (accessed on 15 April 2026).
  13. Stein, W. Sagemath. Available online: www.sagemath.org (accessed on 15 April 2026).
  14. Python Programming Language. Available online: www.python.org (accessed on 15 April 2026).
  15. Askeland, A. An FPGA Accelerated Search Method for Maximum Period NLFSRs; Lecture Notes in Computer Science 15176; Springer: Berlin/Heidelberg, Germany, 2025; ISBN 978-3-031-81823-3. [Google Scholar]
  16. Fletcher, J.C.; Perlman, M. Nonlinear Nonsingular Feedback Shift Registers. U.S. Patent 3911330, 7 October 1975. Available online: https://www.freepatentsonline.com/3911330.html (accessed on 15 April 2026).
  17. Fredricksen, H. A class of nonlinear de Bruijn cycles. J. Comb. Theory Ser. A 1975, 19, 192–199. [Google Scholar] [CrossRef] [Scilit]
  18. Hauge, E.R.; Helleseth, T. De Bruijn sequences, irreducible codes and cyclotomy. Discret. Math. 1996, 159, 143–154. [Google Scholar] [CrossRef] [Scilit]
  19. Hemmati, F. A large class of nonlinear shift register sequences (corresp.). IEEE Trans. Inf. Theory 2003, 28, 355–359. [Google Scholar] [CrossRef] [Scilit]
  20. Jansen, C.J.A. Investigations on Nonlinear Streamcipher Systems: Construction and Evaluation Methods. Doctoral Thesis, Delft University of Technology, Delft, The Netherlands, 1989. [Google Scholar]
  21. Magleby, K.B. The Synthesis of Nonlinear Feedback Shift Registers; Stanford University: Stanford, CA, USA, 1963. [Google Scholar]
  22. Chang, Z.; Wang, H.; Ezerman, M.F.; Fahreza, A.A.; Ling, S.; Szmidt, J. Binary de Bruijn Sequences via Zech’s Logarithms. SN Comput. Sci. 2021, 2, 314. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.