This isn't a very elegant solution as it's just a brute-force search.
I use your code for calculating $C_0$ and just turned it into a function that takes a given list of $\eta$ values:
ClearAll["`*"]
q = 13;
r = 3;
getC0[etas_List, prec_ : $MachinePrecision] :=
Module[{x, term1, term2, f, rootsAll, candRoots, sortedByReal, tau0,
f0},
x =.;
term1 = Times @@ (x - # & /@ etas);
term1 = term1*(x - etas[[1]])^2;
term2 = Times @@ ((x - etas[[1]] + #) & /@ Rest[etas]);
term2 = term2*x^3;
f = Expand[term1 - term2];
rootsAll = x /. NSolve[f == 0, x, WorkingPrecision -> prec];
candRoots = Select[rootsAll, Im[#] > 0 &];
sortedByReal = SortBy[candRoots, Re];
tau0 = Last[sortedByReal];
f0[t_] := Module[{ret, term}, ret = r*etas[[1]]*Log[etas[[1]] - t];
Do[term =
etas[[j]]*Log[t - etas[[j]]] - (etas[[1]] - etas[[j]])*
Log[t - etas[[1]] + etas[[j]]];
ret += term;, {j, 2, q + 1}];
Do[term = 2*etas[[j]]*Log[etas[[j]]];
ret -= term;, {j, 2, r + 1}];
Do[term = (etas[[1]] - 2*etas[[j]])*Log[etas[[1]] - 2*etas[[j]]];
ret += term;, {j, r + 2, q + 1}];
ret];
-N[Re[f0[tau0]], prec]
]
I then use my method from my previous answer to calculate $C_2$ in a relatively fast way (I say relatively because this is still the bottleneck of the code). We find the constant value intervals of $\phi(x)$ and now can do a dot product instead of an integral:
getC2[etalis_List, prec_ : $MachinePrecision] :=
Module[{etasl, msl, phi1, yDecremementTerms, yDecremementCoeffs,
yIncrementTerms, yIncrementCoeffs, yTerms, yCoeffs, phi0, fastPhi,
uniqueEtas, subtractedEtas, kList, yDiscontinuities,
getConstantInterval, changePoints, intervals, phiVals, mBound,
lowerIntervals, lowerPhiVals, int1, int2, constTerm},
etasl = Table[eta[i] -> etalis[[i + 1]], {i, 0, 13}];
msl = Table[
m[j] -> (Max[eta[r], eta[0] - 2 eta[r + 1],
eta[0] - eta[1] - eta[r + j]]) /. etasl, {j, 1, q - r}];
phi1[x_,
y_] := (Sum[(Floor[y] + Floor[eta[0] x - y] -
Floor[y - eta[j] x] - Floor[(eta[0] - eta[j]) x - y] -
2 Floor[eta[j] x]) /. etasl, {j, 1, r}] +
Sum[(Floor[(eta[0] - 2 eta[j]) x] - Floor[y - eta[j] x] -
Floor[(eta[0] - eta[j]) x - y]) /. etasl, {j, r + 1, q}]);
yDecremementTerms = Table[eta[j], {j, 0, q}] /. etasl;
yDecremementCoeffs = -(1 + SparseArray[1 -> 2, q + 1]) // Normal;
yIncrementTerms = Table[(eta[0] - eta[j]), {j, q}] /. etasl;
yIncrementCoeffs = Length /@ Gather[yIncrementTerms];
yIncrementTerms = DeleteDuplicates[yIncrementTerms];
yTerms = Join[yIncrementTerms, yDecremementTerms];
yCoeffs = Join[yIncrementCoeffs, yDecremementCoeffs];
phi0[x_] = phi1[x, 0];
fastPhi[x_] := Module[{ord},
ord = FractionalPart[yTerms*x ] // Ordering;
Min@Accumulate[yCoeffs[[ord]]] + phi0[x]
];
uniqueEtas = uniqueEtas = etalis;
subtractedEtas = Table[eta[0] - eta[j], {j, q}] /. etasl;
kList = Union[uniqueEtas, subtractedEtas];
yDiscontinuities[x_] := FractionalPart[kList*x];
(*gets interval[x,x+ϵ) where phi is a constant value*)
getConstantInterval[x_] :=
Module[{p, ord, w, k, yOrdered, ϵCandidates, ϵ},
p = yDiscontinuities[x];
ord = Ordering[p];
w = Min[(1 - p)/kList];
k = kList[[ord]];
p = p[[ord]];
ϵCandidates = -Differences[p]/Differences[k];
ϵCandidates = Select[ϵCandidates, 0 < # <= w &];
ϵCandidates = Join[ϵCandidates, {w}];
ϵ = Min[ϵCandidates];
x + ϵ];
(*get endpoints of constant phi intervals*)
changePoints = NestWhileList[getConstantInterval, 0, # < 1 &];
(*split into pairs*)
intervals = Partition[changePoints, 2, 1];
phiVals = fastPhi@*Mean /@ intervals;
mBound = 1/m[q - r] /. msl;
lowerIntervals = TakeWhile[intervals, #[[2]] <= mBound &];
lowerPhiVals = Take[phiVals, Length@lowerIntervals][[2 ;; All]];
lowerIntervals = lowerIntervals[[2 ;; All]];
int2 = Flatten[Differences /@ (1/lowerIntervals)] . lowerPhiVals;
int1 =
Flatten[(Differences /@ Map[PolyGamma, Rest@intervals, {2}])] .
Rest[phiVals];
constTerm = r*m[1] + Sum[m[i], {i, 2, q - r}] /. msl;
N[constTerm - (int2 + int1), prec]
]
Then define a test $C_0 > C_2$, with user-supplied precision. The default is $MachinePrecision:
test[etalis_List, prec_ : $MachinePrecision] :=
getC0[etalis, prec] > getC2[etalis, prec]
We limit ourselves to look for a list of $\eta$ of the form:
$$\eta_0=a,\ \ \eta_1=\eta_2=\eta_3=b,\ \ \eta_j=c+j\ \ \text{for}\ \ j=4,5,...,13,$$
Since $\eta_4 ≥ \eta_3$, we have $c ≥ b -4$, and due to the constraints given in the paper
$$
a ≥ \max\left( \frac{\sum_{i=1}^q \eta_i}{5}, 2(c+q)+1 \right)
$$
I modify $c$ to be in terms of $b$, $c = b + k$:
$$\eta_0=a,\ \ \eta_1=\eta_2=\eta_3=b,\ \ \eta_j=(b + k) +j \ \ ,k ≥ -4, \ \ \text{for}\ \ j=4,5,...,13,$$
And now brute force.
etaTest = ConstantArray[0, q + 1];
AbsoluteTiming[
Monitor[
Do[
(*\[Eta]1 = \[Eta]2 = \[Eta]3 = b*)
etaTest[[2 ;; 4]] = b;
(*\[Eta]j = (b+k) + j, k \[GreaterEqual] -4, j = 4,5,...,q*)
etaTest[[5 ;; All]] = (b + k) + Range[4, q];
(*initalize \[Eta]0 at its lower bound*)
a = Ceiling@Max[2 etaTest[[-1]] + 1, Total[Rest@etaTest]/5];
etaTest[[1]] = a;
(* test if C0 > C2*)
isGoodEtaList = test[etaTest];
(*increment \[Eta]0 until we find one such that C0 >
C2 or we hit 100*)
While[isGoodEtaList == False && etaTest[[1]] < 100,
etaTest[[1]] += 1;
isGoodEtaList = test[etaTest];
];
(*stop once we find C0 > C2*)
If[isGoodEtaList, Break[]];
, {b, 100}, {k, -4, 4}
]
, etaTest]
]
etaTest
(*{79, 23, 23, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33}*)
getC0[etaTest, 4]
(*202.*)
getC2[etaTest, 4]
(*201.1*)
This took about 50 minutes on my laptop.
Note I'm kind of cheating by setting an upper bound of 4 for $k$; if I wanted to search the full solution space I'd have increment $k$ until the lower bound of $\eta_0$ is 100
$$
\max\left( \frac{\sum_{i=1}^q \eta_i}{5}, 2(b+k+q)+1 \right) > 100
$$
Which would be a larger space and take longer.
Add-on
To get all $\eta$ lists of our desired form such that $C_0 > C_2$, we can just increase the upper bound of $k$ to 100, and check if the lower bound for $\eta_0$ is less than 100 (this is a computationally cheap check compared to the other calculations we are doing). This took a little over an hour using ParallelDo:
etaTest = ConstantArray[0, q + 1];
AbsoluteTiming[
ParallelEvaluate[pass = {}];
ParallelDo[
(*\[Eta]1 = \[Eta]2 = \[Eta]3 = b*)
etaTest[[2 ;; 4]] = b;
(*\[Eta]j = (b+k) + j, k \[GreaterEqual] -4, j = 4,5,...,q*)
etaTest[[5 ;; All]] = (b + k) + Range[4, q];
(*initalize \[Eta]0 at its lower bound*)
eta0LowerBound =
Ceiling@Max[2 etaTest[[-1]] + 1, Total[Rest@etaTest]/5];
etaTest[[1]] = eta0LowerBound;
(*evaluate test if lower bound is < 100*)
If[eta0LowerBound < 100,
(* test if C0 > C2*)
isGoodEtaList = test[etaTest];
(*increment \[Eta]0 until we find one such that C0 >
C2 or we hit 100*)
While[isGoodEtaList == False && etaTest[[1]] < 100,
etaTest[[1]] += 1;
isGoodEtaList = test[etaTest];
];
(*if C0 > C2, store the \[Eta] list*)
If[isGoodEtaList,
AppendTo[pass, etaTest]
];
];
, {b, 100}, {k, -4, 100}
];
]
And then looking at the $\eta$ lists that pass, we see the one we found before is the smallest by total, and we also see the $\eta$ list specified in the paper:
SortBy[Join @@ ParallelEvaluate[pass], Total]
{
{79, 23, 23, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33},
{81, 24, 24, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34},
{84, 24, 24, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35},
{83, 25, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35},
{86, 25, 25, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36},
{86, 26, 26, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36},
{88, 26, 26, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37},
{89, 27, 27, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37},
{91, 27, 27, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38},
{92, 28, 28, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38},
{94, 28, 28, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39},
{95, 29, 29, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39},
{97, 29, 29, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40},
{98, 30, 30, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40},
{100, 30, 30, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41}
}