(*The file of computations for the arxive.  Many thanks are to B.Noyvert*)
(*Auxiliary part. The degree of the equisingular stratum of curves with one singular point of the type *)
(*\{(Subscript[f, p])+(Subscript[f, p+1])=0\}, for (Subscript[f, p+1]) generic  and the tangent cone is ((Subscript[l, 1])^(Subscript[p, 1]))...((Subscript[l, k])^(Subscript[p, k])) is:*)
Degre[k_,p_]:=Product[p[i],{i,1,k}](Factorial[k]Binomial[Binomial[Sum[p[i],{i,1,k}]+2,2]-1-k,2](((d-Sum[p[i],{i,1,k}]))^2)+Factorial[k-1]Binomial[k+1,2]Binomial[Binomial[Sum[p[i],{i,1,k}]+2,2]-2-k,1](d-Sum[p[i],{i,1,k}])Sum[p[i],{i,1,k}]+If[k>1,Factorial[k-2],0]Binomial[k,2]Binomial[k+2,2]Sum[p[i]*Sum[p[j],{j,i+1,k}],{i,1,k}])

(*Below are enumerations for the following cases. *)
(*curves with two ordinary multiple points*)
(*curves with one singularity of the type \{(Subscript[f, p])+(Subscript[f, p+1])=0\} (for (Subscript[f, p+1]) generic) and one node (Subscript[A, 1])*)
(*curves with one  singularity of the type \{(Subscript[f, p])+(Subscript[f, p+1])+(Subscript[f, p+2])=0\} (here (Subscript[f, p+1]) non-generic but (Subscript[f, p+2]) generic) and one node (Subscript[A, 1])*)
(*******************************************************************************************************************)
(*******************************************************************************************************************)

(*Two ordinary multiple points of multiplicities p+1 and q+1  with p≥q.*)   (*The cohomology class is expressed as the double product. Below p,q are the input parameters. x,y are the classes of lines in the planes, l is the class of in the dual plane, f is the class of hyperplane in the parameter space*)
ClassOMP[p_,q_,x_,y_,l_,f_]:=(x+l)(y+l)(((f+(d-p)x))^(((p+2)(p+1))/2))Product[Product[(f+(d-r-k)y+k*x-r*l-(p+1-r+k)(x+y-l)),{k,0,q-r}],{r,0,q}];
(*Below extract the degree of the stratum: the coefficient of (x^2)(y^2)(l^2)*)
(*To avoid problems with computer memory, the coefficient is extracted by steps, taking the second derivatives*)
DegrOMP[p_,q_]:=(1/8)D[D[D[ClassOMP[p,q,x,y,l,f]/.f->1,{y,2}]/.y->0,{l,2}]/.l->0,{x,2}]/.x->0//Factor

(*Examples:*)
DegrOMP[1,1](*Enumeration of binodal curves, the answer should be divided by 2, as the points are unordered*)
DegrOMP[2,1](*Enumeration of curves with (Subscript[D, 4])(Subscript[A, 1])*)
DegrOMP[3,1](*Enumeration of curves with (Subscript[X, 9])(Subscript[A, 1])*)
DegrOMP[2,2](*Enumeration of curves with (Subscript[D, 4])(Subscript[D, 4]), the answer should be divided by 2, as the points are unordered*)

(*Interpolation. Getting the formula for DegrOMP[_,q]  with fixed q*)
PolOMP[q_]:=InterpolatingPolynomial[Table[{i,DegrOMP[i,q]},{i,q,q+12}],p]//Factor
(*Example: general formula for curves with one (Subscript[A, 1]) and one ordinary multiple point of multiplicity p+1*)
PolOMP[1]
(*Example: general formula for curves with one (Subscript[D, 4]) and one ordinary multiple point of multiplicity p+1*)
PolOMP[2]

(*******************************************************************************************************************)
(*******************************************************************************************************************)
(*******************************************************************************************************************)
(*******************************************************************************************************************)

(*Enumeration of curves with one singularity of the type \{(Subscript[f, p])+(Subscript[f, p+1])=0\} (for (Subscript[f, p+1]) generic) and one node (Subscript[A, 1]). Done by degeneration of \{(Subscript[f, p])+(Subscript[f, p+1])=0\} to the ordinary multiple point  (x^(p+1))+(y^(p+1)). Before doing this, run the part of 2 ordinary multiple points for (p,q=1)  *)

(*the input parameters: k=the number of lines in the tangent cone (Subscript[f, p]). 
m=m[1],m[2],...,m[k] the multiplicities of the lines of the tangent cone. First compute AuxClass1, AuxClass2=the residual pieces over the diagonal*)
AuxClass1[p_,x_,l_,f_]:=(l+x)(((f+(d-p)x))^(((p+1)(p+2))/2))(f+(d-2p-2)x+(p+1)l)(f+(d-1-2p)x+(p-1)l);
AuxClass2[p_,x_,l_,f_]:=(l+x)(((f+(d-p)x))^(((p+1)(p+2))/2))(f+(d-2p-2)x+(p+1)l);
(*ResultOfDegeneration=the total class in the right hand side of the equation. here lx=lx[1],lx[2],..lx[k]*)
(*are the lines of the tangent cone*)
ResultOfDegeneration[k_,m_,x_,y_,l_,lx_,f_]:=Product[(lx[i]+x),{i,1,k}](ClassOMP[Sum[m[i],{i,1,k}],1,x,y,l,f]+2*((x^2)+x*y+(y^2))AuxClass1[Sum[m[i],{i,1,k}],x,l,f]+((x^2)+x*y+(y^2))Sum[If[m[i]==1,(lx[i]+l-x),0],{i,1,k}]AuxClass2[Sum[m[i],{i,1,k}],x,l,f]);
(*Finally the needed class of the equisingular stratum*)
(*Finding the coefficient of ((lx[1])^2)((lx[2])^2)...((lx[k])^2). iteratively*)
Deriv[a_,b_]:=(1/2)D[a,{b,2}]/.b->0
ClassPrelim[k_,m_,x_,y_,l_,f_]:=Fold[Deriv,((ResultOfDegeneration[k,m,x,y,l,lx,f])/(f+(d-Sum[m[i],{i,1,k}])x-Sum[m[i]lx[i],{i,1,k}])),Table[lx[i],{i,1,k}]]
(*Now expanding the obtained expression in the powers of x,y,l*)
ClassPP1[k_,m_,x_,y_,l_,f_]:=Series[ClassPrelim[k,m,x,y,l,f],{x,0,2},{y,0,2},{l,0,2}]//Normal
Degr[k_,m_]:=Coefficient[ClassPP1[k,m,x,y,l,f],(x^2)(y^2)(l^2)]

(*Examples.*)

(*******************************************************************************************************************)
(*The cusp (x^p)+(y^(p+1)) and the node (Subscript[A, 1])*)
PolCuspNode[p_]=InterpolatingPolynomial[Table[v[1]=i;{i,Degr[1,v]/.f->1},{i,2,16}],p]//Factor
(*The answer can be also written in the form: *)(*3p(d-p-1)((((d-p))^3)(1/8)(-1+p)(4+p)(-2+3 p+(p^2))+(1/8)(((d-p))^2)(-1+p)(4+p)(2-3 p+5 (p^2)+2 (p^3))+(1/2)(d-p)p(4-9 p+2 (p^2)+(p^3))-(p^3))   *)

(*the answer can be written as: deg(Cusp)*deg(Node)-(3/8) (((d-p))^2) (p^4) (3+p) (-2+3 p+(p^2))-(3/2) (d-p) (-1+p) (p^3) (-2+3 p+(p^2))+3 (p^4)  
where deg(Cusp) is the degree of the stratum of curves with one singular point of the type (x^p)+(y^(p+1))*)

(*In particular:*)
PolCuspNode[2]//Factor(*(Subscript[A, 2]),(Subscript[A, 1])*)
PolCuspNode[3]//Factor(*(Subscript[E, 6]),(Subscript[A, 1])*)
PolCuspNode[4]//Factor(*((x^4)+(y^5)),(Subscript[A, 1])*)

(*******************************************************************************************************************)
(*The type y((x^p)+(y^(p+1)))  and the node (Subscript[A, 1])*)
Pol[p_]=InterpolatingPolynomial[Table[v[1]=i;v[2]=1;{i,Degr[2,v]/.f->1},{i,2,16}],p]//Factor

(*In particular:*)
(*p=1    (Subscript[A, 1]),(Subscript[A, 1])  should be done separately*)v[1]=1;v[2]=1;(1/2)Degr[2,v]//Factor
(*p=2    (Subscript[D, 5]),(Subscript[A, 1])*)Pol[2]//Factor
(*p=3    y((x^3)+(y^4)),(Subscript[A, 1])*)   Pol[3]//Factor
(*p=4    y((x^4)+(y^5)),(Subscript[A, 1])*)Pol[4]//Factor

(*******************************************************************************************************************)
(*The type ((x^2)+(y^2))((x^p)+(y^(p+1)))  and the node (Subscript[A, 1])*)
Pol[p_]=InterpolatingPolynomial[Table[v[1]=i;v[2]=1;v[3]=1;{i,Degr[3,v]/.f->1},{i,2,20}],p]//Factor

(*In particular:*)
(*p=1     (Subscript[D, 4]),(Subscript[A, 1]). special case, should be done separately*)v[1]=1;v[2]=1;v[3]=1;(1/(3!))Degr[3,v]//Factor
(*p=2     (Subscript[T, 245])=((x^2)+(y^2))((x^2)+(y^3)),(Subscript[A, 1])*)Pol[2]//Factor
(*p=3     ((x^2)+(y^2))((x^3)+(y^4)),(Subscript[A, 1]) *)Pol[3]//Factor

(*******************************************************************************************************************)
(*The type ((x^3)+(y^3))((x^p)+(y^(p+1)))  and the node (Subscript[A, 1])*)
Pol[p_]=InterpolatingPolynomial[Table[v[1]=i;v[2]=1;v[3]=1;v[4]=1;{i,Degr[4,v]/.f->1},{i,2,20}],p]//Factor

(*In particular:*)
(*p=1     (Subscript[X, 9]),(Subscript[A, 1]). special case, should be done separately*)v[1]=1;v[2]=1;v[3]=1;v[4]=1;(1/(4!))Degr[4,v]//Factor
(*p=2     ((x^3)+(y^3))((x^2)+(y^3)),(Subscript[A, 1])*)Pol[2]//Factor
(*p=3     ((x^3)+(y^3))((x^3)+(y^4)),(Subscript[A, 1]) *)Pol[3]//Factor

(*******************************************************************************************************************)
(*The type ((x^(q+1))+(y^q))((x^p)+(y^(p+1)))  and the node (Subscript[A, 1])  one universal polynomial in p,q seems complicated*)
(*so compute for each q separately*)
(*q=2*)
Pol[p_,2]=InterpolatingPolynomial[Table[v[1]=i;v[2]=2;{i,Degr[2,v]/.f->1},{i,2,15}],p]//Factor

(* ((x^3)+(y^2))((x^2)+(y^3))  should be divided by 2 as the branches are not ordered*)   (1/2) Pol[2,2]//Factor
(* ((x^3)+(y^2))((x^3)+(y^4))  *)  Pol[3,2]//Factor

(*q=3*)
Pol[p_,3]=InterpolatingPolynomial[Table[v[1]=i;v[2]=3;{i,Degr[2,v]/.f->1},{i,3,15}],p]//Factor

(* ((x^3)+(y^2))((x^3)+(y^4))  should be divided by 2 as the branches are not ordered*)  (1/2)Pol[3,3]//Factor
(* ((x^3)+(y^2))((x^4)+(y^45))*)  Pol[4,3]//Factor

(*******************************************************************************************************************)
(*******************************************************************************************************************)
(*******************************************************************************************************************)
(*******************************************************************************************************************)
(*Enumeration of curves with one point of type (x^p)+(x^n)(y^(p-n))+(xy^p)+(y^(p+2))=((x^(p-n))+(y^(p-n)))((x^(n-1))+(y^n))(x-(y^2)) and one (Subscript[A, 1]). Here p>1.*)   
(*the input parameters are: k=the number of lines in the tangent cone (Subscript[f, p]). m=m[1]...m[k] the multiplicities of the lines of the tangent cone.  Assume: m[1]=k  and lx[1] is the tangent line*)
(*Done by killing the tangent cone: (x^p)+(x^k)(y^(p-k))+(xy^p)+(y^(p+2)) -->((x^(p+1))+(xy^p)+(y^(p+2))). First run the procedure for 2 ordinary multiple points.*)
(*The class of ((x^(p+1))+(xy^p)+(y^(p+2)))(Subscript[A, 1]) is obtained by degeneration from ((x^(p+1))+(y^(p+1)))(Subscript[A, 1]) *)
xpA1tang[p_,x_,y_,l_,lx_,f_]:=ClassOMP[p,1,x,y,l,f]((d-2p-2)x+f+(p+1)*lx[1]);
(* Now compute AuxClass1, AuxClass1=the residual pieces over the diagonal*)
AuxClass1[p_,x_,l_,lx_,f_]:=(l+x)Coefficient[Sum[((((d-p-1)x+f))^((((p+3)(p+2))/2)-1-i))(((2l+lx[1]+A))^i),{i,0,(((p+3)(p+2))/2)-1}](((A+x))^(((p-1)(p-2))/2)),A,(((p-1)(p))/2)-1];
AuxClass2[p_,x_,l_,lx_,f_]:=(l+x)Coefficient[Sum[((((d-p-1)x+f))^((((p+3)(p+2))/2)-1-i))(((l+lx[1]+A))^i),{i,0,(((p+3)(p+2))/2)-1}](((A+x))^(((p-1)(p))/2)),A,(((p+1)(p))/2)-1];
(*ResultOfDegeneration=the total class in the right hand side of the equation. here lx=lx[1],lx[2],..lx[k]*)
(*are the lines of the tangent cone*)
ResultOfDegeneration[k_,m_,x_,y_,l_,lx_,f_]:=
Product[(lx[i]+x),{i,1,k}](xpA1tang[Sum[m[i],{i,1,k}],x,y,l,lx,f]+2*((x^2)+x*y+(y^2))AuxClass1[Sum[m[i],{i,1,k}],x,l,lx,f]+((x^2)+x*y+(y^2))Sum[If[m[i]==1,(lx[i]+l-x),0],{i,1,k}]AuxClass2[Sum[m[i],{i,1,k}],x,l,lx,f])
(*Finally the needed class of the equisingular stratum*)
(*Finding the coefficient of ((lx[1])^2)((lx[2])^2)...((lx[k])^2). iteratively*)
Deriv[a_,b_]:=(1/2)D[a,{b,2}]/.b->0
ClassPrelim[k_,m_,x_,y_,l_,f_]:=Fold[Deriv,((ResultOfDegeneration[k,m,x,y,l,lx,f])/(f+(d-Sum[m[i],{i,1,k}])x-Sum[m[i]lx[i],{i,1,k}])),Table[lx[i],{i,1,k}]]
(*Now expanding the obtained expression in the powers of x,y,l*)
ClassSingAndNode[k_,m_,x_,y_,l_,f_]:=Series[ClassPrelim[k,m,x,y,l,f],{x,0,2},{y,0,2},{l,0,2}]//Normal;
DegreeSingAndNode[k_,m_]:=Coefficient[ClassSingAndNode[k,m,x,y,l,f],(x^2)(y^2)(l^2)]//Factor

(*Examples. Here lx[1]  is allways the tangent to singular branches*)

(*n=p, (x^p)+(xy^p)+(y^(p+2))=((x^(p-1))+(y^p))(x-(y^2))*)
v[1]=2;DegreeSingAndNode[1,v](*Enumeration of curves with (Subscript[A, 3])(Subscript[A, 1])*)
v[1]=3;DegreeSingAndNode[1,v](*Enumeration of curves with (Subscript[E, 7])(Subscript[A, 1])*)
v[1]=4;DegreeSingAndNode[1,v](*Enumeration of curves with ((x^4)+(xy^4)+(y^6))(Subscript[A, 1])*)

(*An auxiliary computation. The degree for curves with one sing point of the type (x^p)+(xy^p)+(y^(p+2))*)
(*De[p_]:=Coefficient[Sum[(((f+(d-p)x))^((((p+2)(p+1))/2)-1-i))(((p*l))^i),{i,0,(((p+2)(p+1))/2)-1}](l+x)(f+(d-2p-2)x+(p+1)l),(x^2)(l^2)]//Factor*)
(*Gives: De[p]=(1/8) (((d-p))^2) p (3+p) (1+2 p) (-2+3 p+(p^2))+(1/2) (d-p) (-1+p) p (-2+3 p+(p^2))-(p^2) (2+p)*)
De[p_]:=(1/8) (((d-p))^2) p (3+p) (1+2 p) (-2+3 p+(p^2))+(1/2) (d-p) (-1+p) p (-2+3 p+(p^2))-(p^2) (2+p);

Pol[p_]=InterpolatingPolynomial[Table[v[1]=i;{i,-De[i]3(((d-1))^2)+DegreeSingAndNode[1,v]/.f->1},{i,2,12}],p]//Factor

Pol[p_]=De[p]3(((d-1))^2)-(3/8) (((d-p))^2) (p^2) (1+p) (2+p) (3+p) (4+p+2 (p^2))-(3/2) (d-p) (p^2) (3+p) (-8-p-3 (p^2)+(p^3))+3 p (-4+4 p+3 (p^2)+3 (p^3)+(p^4))

(*n=p-1, (x^(p-1))y+(xy^p)+(y^(p+2))=(x+y)((x^(p-2))+(y^(p-1)))(x-(y^2))  thus p>2*)
v[1]=2;v[2]=1;DegreeSingAndNode[2,v](*Enumeration of curves with (Subscript[D, 6])(Subscript[A, 1])*)
v[1]=3;v[2]=1;DegreeSingAndNode[2,v](*(x+y)((x^2)+(y^3))(x-(y^2)),(Subscript[A, 1])*)
v[1]=4;v[2]=1;DegreeSingAndNode[2,v](*(x+y)((x^3)+(y^4))(x-(y^2)),(Subscript[A, 1])*)

(*n=2, (x^p)+(x^2)(y^(p-2))+(xy^p)+(y^(p+2))=((x^(p-2))+(y^(p-2)))(x+(y^2))(x-(y^2))  thus p>2*)
v[1]=2;v[2]=1;DegreeSingAndNode[2,v]    (*Enumeration of curves with (Subscript[D, 6])(Subscript[A, 1])*)
v[1]=2;v[2]=1;v[3]=1;(1/2)DegreeSingAndNode[3,v]    (*((x^2)+(y^2))((x^2)+(y^4))(Subscript[A, 1])*)
v[1]=2;v[2]=1;v[3]=1;v[4]=1;(1/(3!))DegreeSingAndNode[4,v] (*((x^3)+(y^3))((x^2)+(y^4)),(Subscript[A, 1])*)

(*An auxiliary computation. The degree for curves with one sing point of the type (x^p)+(x^2)(y^(p-2))+(xy^p)+(y^(p+2))=((x^(p-2))+(y^(p-2)))((x^2)-(y^4))*)
(*De[p_]:=Coefficient[Coefficient[Sum[(((f+(d-p)x))^((((p+2)(p+1))/2)-1-i))(((2l+A))^i),{i,0,(((p+2)(p+1))/2)-1}](((A+x))^(((p-1)(p-2))/2))(l+x)(f+(d-2p-2)x+(p+1)l),A,((p(p-1))/2)-1],(x^2)(l^2)]//Factor*)
(*Gives: De[p]=*)
De[p_]:=(1/8) (((d-p))^2) (-1+3 p) (2+p+(p^2)) (4+p+(p^2))+(1/4) (d-p) (-1+p) (2+p+(p^2)) (-6-p+3 (p^2))+(1/8) (-1+p) p (-14-29 p-4 (p^2)+3 (p^3));

(*Obtaining the general formula for ((x^(p-2))+(y^(p-2)))(x+(y^2))(x-(y^2)). Takes a lot of time. The answer is at the end*)

v[i_]=If[i==1,2,1];
Valu1=Table[{i,-De[i+1]3(((d-1))^2)+(1/((i-1)!))DegreeSingAndNode[i,v]/.f->1//Factor},{i,2,8}]

Valu2=Table[{i,-De[i+1]3(((d-1))^2)+(1/((i-1)!))DegreeSingAndNode[i,v]/.f->1//Factor},{i,9,10}]

Valu3=Table[{i,-De[i+1]3(((d-1))^2)+(1/((i-1)!))DegreeSingAndNode[i,v]/.f->1//Factor},{i,11,14}]

(*For this last part it takes about 24 hours*)

Valu4=Table[{i,-De[i+1]3(((d-1))^2)+(1/((i-1)!))DegreeSingAndNode[i,v]/.f->1//Factor},{i,15,16}]

valu=Union[Valu1,Valu2,Valu3,Valu4]

Pol[p_]=Series[InterpolatingPolynomial[valu,p],{d,p,5}]//Normal

-(3/8) (((d-p))^2) (240+786 p+907 (p^2)+702 (p^3)+341 (p^4)+117 (p^5)+24 (p^6)+3 (p^7))//Factor
-171-546 p-354 (p^2)-153 (p^3)-30 (p^4)//Factor
(3/2) (d-p) (174+573 p+560 (p^2)+363 (p^3)+135 (p^4)+32 (p^5)+3 (p^6))//Factor

(*Therefore the degree for ((x^(p-2))+(y^(p-2)))((x^2)-(y^4)),(Subscript[A, 1])  is: deg(((x^(p-2))+(y^(p-2)))((x^2)-(y^4)))*deg((Subscript[A, 1]))+De[p]  for:*)
De[p_]:=-(3/8) (((d-p))^2) (6+3 p+(p^2)) (8+3 p+(p^2)) (5+12 p+6 (p^2)+3 (p^3))+(3/2) (d-p) (6+3 p+(p^2)) (29+81 p+48 (p^2)+23 (p^3)+3 (p^4))-3 (57+182 p+118 (p^2)+51 (p^3)+10 (p^4));