Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Try this:

pol = lfsr_connection_polynomial(L)
P = PolynomialRing(GF(2),'y')
R.<y> = P.quotient(pol)
O = 2^pol.degree()-1
for p,d in factor(O):
    while (O%p==0) and (y^(O//p)==1):
        O //= p
print("order =",O)

Try this:

pol = lfsr_connection_polynomial(L)
P = PolynomialRing(GF(2),'y')
R.<y> = P.quotient(pol)
O = 2^pol.degree()-1
for p,d in factor(O):
    while (O%p==0) and (y^(O//p)==1):
        O //= p
print("order print("period =",O)

Try this:

pol = lfsr_connection_polynomial(L)
P = PolynomialRing(GF(2),'y')
R.<y> = P.quotient(pol)
O = 2^pol.degree()-1
for p,d p,_ in factor(O):
    while (O%p==0) and (y^(O//p)==1):
        O //= p
print("period =",O)