How to assign each distinct irreducible polynomial as a quotient of a polynomial ring respect to n.

13 views
Skip to first unread message

Gekonga Wanchoke CHACHA

unread,
Apr 13, 2017, 9:53:27 AM4/13/17
to sage-support


Dear all, The code below works for finding  for B each n
D=[]
F=[]
B=[]
Z=[]
for n in range(1,10,2):
    Z.append(Integers(n)(2).multiplicative_order())
for r in Z:
    if r%2!=0:
        B.append(2^r-1)
    else:
        M=r/2
        if r%n==-1:
            B.append(n*(2^(r/2)-1))
        else:
            B.append(2^r-1)
for b in B:
    divisors(b)      
The part  below is to create the cyclotomic polynomial for all divisors of n an find all irreducible polynomials ove F2 by factor.
D=[divisors(b) for b in B]
F.<x>=GF(2)[]
G=[]
K=[]
P=[]
for h in range(1,10,2):
    for t in divisors(h):
        G.append(F.cyclotomic_polynomial(t))
for g in G:
    K.append(g.factor())
    P.append((K[i][j][0] for i in range(len(K)) for j in range(len(K[i]))))
for b in D:
    for f in P:
        F.<j>=F.quotient(f)
        if (j+1)^b==1:
            print(b)
            break
Question: I want to use each factor of polynomial correspond to n to  find the divisors of each element in B which  if it  is a power of  x +1 gives one....But i fail to because gives error when i sign ech factor as a quotient. And it gives error
unable to coerce <type 'generator'> to an integer
 
Reply all
Reply to author
Forward
0 new messages