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Cond1[κ_,μ_,m_]:=((μ^2)+((8 (μ^3))/κ))-9(m^2);
Cond2[κ_,μ_,m_]:=(((μ^2)/(3κ))+((2 μ)/3))+m;
Cond3[κ_,μ_,m_]:=((μ^2)/(2κ))+(((1 )/2)-(1/κ))μ+(5/6)+(7/(6κ))+m;
Cond4[κ_,μ_,m_]:=((2(μ^2))/(3κ))+2μ+((17κ)/24)+((21 κ (m^2))/(8 (μ^2)))+((3 κ m)/μ)+3m;
μn[μ_,n_]:=μ+(n+1)κ;
mn[μ_,m_,n_]:=m-(n+1)μ-(κ/2)(n+1)(n+2);

Findn[κ,μ_,m_]:=Module[{x,μ0,m0,n}, Cond=False; n=0;
While [!Cond,
n=n+1;
μ0=μn[μ,n];
m0=mn[μ,m,n];
Cond=Cond1[κ,μ0,m0]<0&& Cond2[κ,μ0,m0]<0&&Cond3[κ,μ0,m0]<0&&Cond4[κ,μ0,m0]<0
];
n
];
ChiO1[κ_,c_,μ_,M_,n_]:=((κ )/2)n(n+1)+n μ-M+(κ/6)+(c/12);
Fac1[κ_,c_,μ_,M_,n_]:=((((-1))^(ChiO1[κ,c,μ,M,n]+1))/(ChiO1[κ,c,μ,M,n]));
S1[κ_,c_,μ_,M_,n_]:=Fac1[κ,c,μ,M,n]PT[μn[μ,n],mn[μ,M,n]];

κ=5;
c=50;
μ=0;
M=0;
Print["n=",Findn[κ,μ,M],"   (Subscript[μ, n])=",μn[μ,n],"  (Subscript[m, n])=",mn[μ,M,n]]
Print["J(",μ,",",M,")=",S1[κ,c,μ,M,n]]

With[{κ=5,c=50,μ=2},Table[Findn[κ,μ,M],{M,0,15}]]

ClearAll[κ,c,μ,M,m,n];
With[{μ=0},Simplify[{Cond1[κ,μn[μ,n],mn[μ,m,n]],Cond2[κ,μn[μ,n],mn[μ,m,n]],Cond3[κ,μn[μ,n],mn[μ,m,n]],Cond4[κ,μn[μ,n],mn[μ,m,n]]}]]

Simplify[Series[{Cond1[κ,μn[μ,n],mn[μ,m,n]],Cond2[κ,μn[μ,n],mn[μ,m,n]],Cond3[κ,μn[μ,n],mn[μ,m,n]],Cond4[κ,μn[μ,n],mn[μ,m,n]]},{n,Infinity,0}]]

son=Solve[Cond3[κ,μn[μ,n],mn[μ,m,n]]==0,n][[1]]

n/.son/.{κ->1}

With[{κ=1,μ=0},Simplify[{Cond2[κ,μn[μ,n],mn[μ,m,n]]/.son,Cond4[κ,μn[μ,n],mn[μ,m,n]]/.son}]]

FullSimplify[Cond2[κ,μn[μ,n],mn[μ,m,n]]/.son]

Solve[(1/36) (8-8 κ+(κ^2))==0]//N

Simplify[Series[{Cond1[κ,μn[μ,n],mn[μ,m,n]],Cond2[κ,μn[μ,n],mn[μ,m,n]],Cond4[κ,μn[μ,n],mn[μ,m,n]]}/.son,{m,Infinity,0}]]

Simplify[Series[{Cond1[κ,μn[μ,n],mn[μ,m,n]],Cond2[κ,μn[μ,n],mn[μ,m,n]],Cond4[κ,μn[μ,n],mn[μ,m,n]]}/.son,{m,Infinity,-3}]]

Cond1[κ,μ0,m0]
Cond2[κ,μ0,m0]
Cond3[κ,μ0,m0]
Cond4[κ,μ0,m0]