13 lines
318 B
Python
13 lines
318 B
Python
|
F = GF(2)
|
||
|
PR = PolynomialRing(F, 'x')
|
||
|
|
||
|
max_k = 31
|
||
|
whitespace = max_k+1
|
||
|
|
||
|
for i in range(1, max_k+1):
|
||
|
poly_int = '0b'+ ''.join(map(str, PR.irreducible_element(i).coefficients(sparse=False)[::-1]))
|
||
|
poly_int += ','
|
||
|
poly_int += ' '*(max_k-i)
|
||
|
print(f' {poly_int}// irreducible polynomial of degree {i}')
|
||
|
|