First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 4 years ago

Max Alekseyev gravatar image

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)
click to hide/show revision 2
No.2 Revision

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)
click to hide/show revision 3
No.3 Revision

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)