divisor polynomials by rotary-o

1.upto(200){|i|*a=1
1.upto(i){|j|i%j<1&&a=[0,*a].zip(a<<0).map{|k,l|k-j*l}}
m=-1
puts a.map{|k|m+=1
(k==1?'+':m<1?'%d':'%+d')%k+(m>1?'x^%d':'x'*m)%m}*''}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page