[VA] SRC #012c - Then and Now: Sum
|
11-30-2022, 09:15 AM
(This post was last modified: 11-30-2022 10:29 AM by J-F Garnier.)
Post: #11
|
|||
|
|||
RE: [VA] SRC #012c - Then and Now: Sum
Since we are several to have tried the brute force approach, here are my results that show that it's a no go.
I rewrote 1/f(n) to 1/(n.f(d)) and used the fact that all the n values between 2^d and 2^(d+1)-1 have the same number of binary digits d+1 so the sum of these values can be factored with the same f(d+1). Translated into code (sorry for the change of notation): J1=2^(K-1) @ J2=2*J1-1 S=0 @ FOR J=J1 TO J2 @ S=S+1/J @ NEXT J S1=S1+S/F(K) I also noticed that the intermediate value S converges to LOG(2), so to have an idea of how the series behaves I replace the partial sum S with LOG(2) for K>=15, i.e. for the f(n) with n>2^15. I went up to K=4000, i.e. numbers with 4000 binary digits (> 10^1200) , and the sum has still not converged. I can just say that the sum is larger than 1.95, which is compatible with both Werner and Thomas prelim results. Any confirmation of my analysis is welcome! 10 ! SRC12C 20 L=4000 30 DIM F(L) 40 ! calculate the first L F(I) 50 F(1)=1 @ F(2)=2 60 FOR I=3 TO L 70 D=INT(LOG(I)/LOG(2))+1 90 F(I)=I*F(D) 100 NEXT I 120 ! 130 S1=1/F(1)+1/F(2)+1/F(3) 140 FOR K=3 TO L 142 S=LOG(2) ! approx value used for K>=15 145 IF K>=15 THEN 210 150 J1=2^(K-1) @ J2=2*J1-1 170 S=0 @ FOR J=J1 TO J2 @ S=S+1/J @ NEXT J 210 S1=S1+S/F(K) 220 IF K<15 OR MOD(K,500)=0 THEN DISP K;S;S1 230 NEXT K 235 END >RUN K, partial sum S, sum S1 3 .759523809524 1.79325396826 4 .725371850372 1.82347779536 5 .709016202207 1.84711166877 6 .701020708269 1.86658446622 7 .697068688885 1.88318133976 8 .695104120223 1.88680167372 9 .694124696722 1.89001521398 10 .693635700225 1.89290536273 11 .693391380792 1.89553184523 12 .693269265777 1.89793903018 13 .69320821942 1.9001608514 14 .693177699089 1.90222388027 500 .69314718056 1.95019974933 (S estimated from here) 1000 .69314718056 1.95220716995 1500 .69314718056 1.95327727197 2000 .69314718056 1.95403237901 2500 .69314718056 1.95457439294 3000 .69314718056 1.9550131171 3500 .69314718056 1.95538406366 4000 .69314718056 1.95570539887 J-F |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)