One-liner mini-challenge [HP-71B]
|
04-22-2015, 10:57 PM
(This post was last modified: 04-24-2015 04:14 PM by Gerson W. Barbosa.)
Post: #16
|
|||
|
|||
RE: One-liner mini-challenge [HP-71B]
Hello again, Valentin,
(04-20-2015 09:23 PM)Valentin Albillo Wrote:(04-20-2015 04:41 PM)Gerson W. Barbosa Wrote: At page 81 of his book Prime Obsession, John Derbyshire says: It's still working here. There are links that lead to chapters 5 and 6 in page vii (Contents), but I cannot copy them: 5 Riemann’s Zeta Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6 The Great Fusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 The other day links to more chapters were available though. (04-20-2015 09:23 PM)Valentin Albillo Wrote:(04-20-2015 04:41 PM)Gerson W. Barbosa Wrote: But I digress. Back to your very short solution, I would like to point out I get your exact result for n = 1, using this series, disregarding the last term: [...] The sixth term doesn't help much for n = 1, [...] You are right! Although the sixth term improves the result for n = 1, albeit only slightly, the seventh term makes it equal 1.00005029507, which is slightly worse than the two previous results. Curve fitting is an option if we want more accurate results for small numbers, as you can see in the (not so small) HP-42S program. Best regards, Gerson. HP-42S program: Code:
Examples: 1 .... 1.............(.....1....) 2 .... 2.41421356235 (.....6237 ) 3 .... 4.14626436995 (.....6994 ) 4 .... 6.14626436989 (.....6994 ) 5 .... 8.38233234743 (.....4744 ) 10.... 22.4682781862 (.....1862 ) 100... 671.462947104 (.....7103 ) 1.E12. 6.66666666668E17 (....67 ) 1.E333 2.10818510678E499 (...78 ) a := 2*n*sqrt(n)/3 b := 3*a/(4*n) c := b/(12*n) d := c/(80*n^2) e := 5*d/(24*n^2) s := (a + b + c - d + e - 0.207886224977355)/(1 + ln(1 + exp(-8.03012316626854*ln(n) - 9.07189622971032 - 1.19449787181792/n))) P.S.: On the HP-71B, this hardly fits in two lines: Code:
? 1 1 ? 2 2.41421356235 ? 3 4.14626436995 ? 4 6.14626436989 ? 5 8.38233234743 ? 10 22.4682781862 ? 100 671.462947104 ? 1E12 6.66666666668E17 ? 1E333 WRN L1:Underflow WRN L2:Underflow 2.10818510678E499 P.P.S.: The constant 9.07189622971 in step 40 of the the HP-42S program and in line 2 of the HP-71B program has how been corrected. Previously the second '9' was missing: 9.0718622971. As a result, both programs now return 1 exactly for n = 1. I ought to have noticed 0.99999999882 was way off! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)