for(i<-1 to 200;b=BigInt(0))println{var a=Seq(b+1)
for(j<-1 to i if i%j<1)a=b+:a zip a:+b map(t=>t._1-j*t._2)
var s=""
var l=0
a.map{k=>if(k*l>0)s+="+"
if(k!=1)s+=k
s+=Seq("x^"+l,"x","")(2>>l)
l+=1}
s}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).