Post Reply 
(Spoilers!) Comments and discussion on Valentin's 5th "Then and Now" - Roots
02-15-2023, 09:31 PM
Post: #7
RE: (Spoilers!) Comments and discussion on Valentin's 5th "Then and Now" - R...
Hi all,

As a fan of Valentín's challenges, I've also been silently working on this one, but have not been able to make much progress.

I have taken the code for the R(x) function from Valentín's Small Fry - Primes A'counting article.

You just need to modify line 170 to remove the rounding in the final result:

100 DEF FNZ(Z) @ IF Z=2 THEN FNZ=PI*PI/6 ELSE IF Z=3 THEN FNZ=1.20205690316
110 IF Z=4 THEN FNZ=1.08232323371 ELSE IF Z=5 THEN FNZ=1.03692775514
120 IF Z=6 THEN FNZ=1.01734306198 ELSE IF Z=7 THEN FNZ=1.00834927738
130 IF Z<8 THEN END ELSE S=1 @ T=0 @ N=2
140 S=S+N^(-Z) @ N=N+1 @ IF S<>T THEN T=S @ GOTO 140 ELSE FNZ=S
150 DEF FNR(N) @ J=LN(N) @ R=1 @ N=1 @ K=1
160 R=R+1/(K*FNZ(K+1))*J^K/FACT(K) @ IF R<>N THEN K=K+1 @ N=R @ GOTO 160
170 FNR=R @ END DEF

Playing with the FNR function, I see that there is a change from positive to negative values somewhere in the range x=4E-11 to x=5E-11. So there is at least a root inside this range.

I've tried using FNROOT to find the root in this range, and I get the result:

4.3618520797E-11

But FNR of this value is not zero, but something like 1.6E-4, so I don't trust that this is a real root.

Playing with other values of FNR, I see that for x=6E-11 the function is again negative. So there seems to be a another root between x=5E-11 and x=6E-11. Using FNROOT in that range, I get the root:

5.99999999973E-11

But then, curiously, I see these values for FNR:

FNR(5.99999999973E-11) = 3.26676946469E-4
FNR(6E-11) = -8.11848710502E-5

So, it appears that there is a root very close to 6E-11.

But maybe I'm only getting garbage results all the time, or the function is too tricky for FNROOT to handle.

I've tried a change of variables in the x axis. All you need to do is modify line 150:

150 DEF FNR(N) @ J=N @ R=1 @ N=1 @ K=1

And you see the R(x) function with a logarithmic scale in the x axis. But root finding with FNROOT does not seem to get any better by doing this.

This is how far I have gotten so far. I'll keep working on it, but I fear this challenge is utterly beyond my reach.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (Spoilers!) Comments and discussion on Valentin's 5th "Then and Now" - R... - Fernando del Rey - 02-15-2023 09:31 PM



User(s) browsing this thread: 1 Guest(s)