syms x a;
%被除式的多项式
num=1+a^12*x+a^13*x^2;
%除式的多项式
c=[1 0 0 1 1];%除式为a^4+a+1;
%用来存使余式为零的x的矩阵e
e=[];
%x从x=a开始到x=a^15代入到num中
x=a;
for i=1:15
x=x*a;
num=1+(a^12)*x+(a^13)*x^2;
b=sym2poly(num);%取多项式的系数
[q r]=deconv(b,c);%除
if r(end)==0 %如果余式为零 ,存入e[]
e=[e,x];
end
end
e