# Problem with Solve and PrimeZetaP

I assume this is something to do with limits on numerical precision, but can someone explain the difference in output between these two Solve problems:

Solve[PrimeZetaP[s] == 1.434, s]


{{s -> 1.222683551}}

and

Solve[PrimeZetaP[s] == 1.435, s]


Solve was unable to solve the system with inexact coefficients or the system obtained by direct rationalization of inexact numbers present in the system. Since many of the methods used by Solve require exact input, providing Solve with an exact version of the system may help.

Solve[PrimeZetaP[s] == 1.434, s]

Obviously, I've hit some kind of threshold - but what and why?

UPDATE:

Following @Artes's suggestion below, I tried

FindRoot[PrimeZetaP[s] == 1.435, {s, 2}]


{s -> 1.222402031}

Clearly, this works. But now this...

FindRoot[PrimeZetaP[s] == 1.445, {s, 2}]


{s -> 2.}

...doesn't.

There seems to be a threshold (call it t) somewhere in the region 1.434 < t < 1.44 where it becomes impossible to obtain a result, as this table shows:

TableForm[Table[
{n, Solve[PrimeZetaP[s] == n, s],
FindRoot[PrimeZetaP[s] == n, {s, 2}]},
{n, 1.43, 1.44, 0.001}]]


Further thoughts, anyone? The error messages suggest I should use Reduce - but I'm not sure how to apply it in this instance; If I use Reduce[PrimeZetaP[s] == n, s] in the table above, I get nothing.

• Solve works with exact numbers, however for transcendental functions it should be used with appropriate bounds on variables. See e.g. more detailed discussion. Nevertheless Solve cannot solve all equations involving transcendental functions. Try FindRoot[PrimeZetaP[s] == 1.435, {s, 2}] – Artes Feb 12 '20 at 14:19
• Thanks @Artes. I've updated the question above. There still seems to be some limit beyond which Mathematica simply cannot tackle the problem. – Richard Burke-Ward Feb 12 '20 at 15:20
• There will always be some limits beyond which Mathematica simply cannot tackle many problems. The issues with Solve and Reduce are discussed here. Read it carefully. There are some limits where Solve can call NSolve, it doesn't matter here since FindRoot is the way to go, FindRoot[PrimeZetaP[s] == 4.45, {s, 1.2}]. – Artes Feb 12 '20 at 15:49
• Thanks @Artes. Do you want to turn that into an answer so I can tick it? – Richard Burke-Ward Feb 12 '20 at 22:09
• I guess this problem comes from a simple mistake and can be simply found in the documentation and so the question might be closed or deleted as you prefer. – Artes Feb 12 '20 at 22:27

FindRoot needs a good initial estimate

Clear["Global*"]


To get an initial estimate for FindRoot, find a fit for values of {PrimeZetaP[s], s}

data = Table[{PrimeZetaP[s], s}, {s, 1.1, 2, 0.01}];


Using FindFit

f[p_] = a*p^2 + b*p + c /. FindFit[data,
a*p^2 + b*p + c, {a, b, c}, p]

(* 2.59273 - 1.65311 p + 0.467891 p^2 *)


Looking at the fit

{pmin, pmax} = MinMax[data[[All, 1]]]

(* {0.452247, 2.10884} *)

Plot[f[p], {p, pmin, pmax}, Epilog -> {Red,
AbsolutePointSize[4], Point[data]}]


Verifying that FindRoot works using better initial estimates

s /. FindRoot[PrimeZetaP[s] == #, {s, f[#]},
WorkingPrecision -> 15] & /@
Range[1.4315, 1.4415, 0.00115]

(* {1.22381388261206, 1.22353066085125, 1.22324786557684, 1.22296549598819, \
1.22268355128654, 1.22240203067502, 1.22212093335863, 1.22184025854421, \
1.22156000544051, 1.22128017325810, 1.22100076120941} *)