Хочу найти все делители числа
Вот для простых
:
Код:
? forprime(p=2,30, print("p = ",p,":"); f=factor((t+1)^p-t^p-1); for(i=1,matsize(f)[1],f[i,1]=subst(f[i,1],t,x/y)*y^poldegree(f[i,1])); print(f); print() )
p = 2:
Mat([x, 1])
p = 3:
[x, 1; x + y, 1]
p = 5:
[x, 1; x + y, 1; x^2 + y*x + y^2, 1]
p = 7:
[x, 1; x + y, 1; x^2 + y*x + y^2, 2]
p = 11:
[x, 1; x + y, 1; x^2 + y*x + y^2, 1; x^6 + 3*y*x^5 + 7*y^2*x^4 + 9*y^3*x^3 + 7*y^4*x^2 + 3*y^5*x + y^6, 1]
p = 13:
[x, 1; x + y, 1; x^2 + y*x + y^2, 2; x^6 + 3*y*x^5 + 8*y^2*x^4 + 11*y^3*x^3 + 8*y^4*x^2 + 3*y^5*x + y^6, 1]
p = 17:
[x, 1; x + y, 1; x^2 + y*x + y^2, 1; x^12 + 6*y*x^11 + 26*y^2*x^10 + 75*y^3*x^9 + 156*y^4*x^8 + 240*y^5*x^7 + 277*y^6*x^6 + 240*y^7*x^5 + 156*y^8*x^4 + 75*y^9*x^3 + 26*y^10*x^2 + 6*y^11*x + y^12, 1]
p = 19:
[x, 1; x + y, 1; x^2 + y*x + y^2, 2; x^12 + 6*y*x^11 + 28*y^2*x^10 + 85*y^3*x^9 + 184*y^4*x^8 + 292*y^5*x^7 + 341*y^6*x^6 + 292*y^7*x^5 + 184*y^8*x^4 + 85*y^9*x^3 + 28*y^10*x^2 + 6*y^11*x + y^12, 1]
p = 23:
[x, 1; x + y, 1; x^2 + y*x + y^2, 1; x^18 + 9*y*x^17 + 57*y^2*x^16 + 252*y^3*x^15 + 836*y^4*x^14 + 2156*y^5*x^13 + 4423*y^6*x^12 + 7324*y^7*x^11 + 9880*y^8*x^10 + 10911*y^9*x^9 + 9880*y^10*x^8 + 7324*y^11*x^7 + 4423*y^12*x^6 + 2156*y^13*x^5 + 836*y^14*x^4 + 252*y^15*x^3 + 57*y^16*x^2 + 9*y^17*x + y^18, 1]
p = 29:
[x, 1; x + y, 1; x^2 + y*x + y^2, 1; x^24 + 12*y*x^23 + 100*y^2*x^22 + 594*y^3*x^21 + 2695*y^4*x^20 + 9702*y^5*x^19 + 28432*y^6*x^18 + 69042*y^7*x^17 + 140695*y^8*x^16 + 242784*y^9*x^15 + 357010*y^10*x^14 + 449232*y^11*x^13 + 484867*y^12*x^12 + 449232*y^13*x^11 + 357010*y^14*x^10 + 242784*y^15*x^9 + 140695*y^16*x^8 + 69042*y^17*x^7 + 28432*y^18*x^6 + 9702*y^19*x^5 + 2695*y^20*x^4 + 594*y^21*x^3 + 100*y^22*x^2 + 12*y^23*x + y^24, 1]