Post Reply 
One-liner mini-challenge [HP-71B]
04-20-2015, 04:41 PM
Post: #14
RE: One-liner mini-challenge [HP-71B]
(04-19-2015 03:32 PM)Valentin Albillo Wrote:  .
Hi, Gerson:

(04-17-2015 01:46 PM)Gerson W. Barbosa Wrote:  Perhaps this is a more interesting problem:

\[\sqrt{1}+\sqrt{2}+\sqrt{3}+\sqrt{4}+\sqrt{5}+\cdots+\sqrt{n}\]

.
This 69-char HP-71B one-liner will probably do as well:

INPUTN@2/3*N^1.5+N^.5/2-0.207886224977+(1-1/80/N^2+1/384/N^4)/N^.5/24

which gives 12-digit precision for arguments as low as 7 or 8 and even 6-digit precision (save for a few ulps) for arguments as low as 1 ! (1,00003...).

The constant is Zeta(-1/2). Of course one or several final terms can be omitted if desired for a shorter expression with somewhat reduced accuracy.

Regards.
V.
.


Hello Valentin,

Thank you for your ongoing interest in this fascinating subject!

At page 81 of his book Prime Obsession, John Derbyshire says:

"...if you take the trouble to actually work out the sums and add them up, you see that the first ten terms add up to 5.020997899..., the first hundred add up to 18.589603824..., the first thousand add up to 61.801008765..., the first ten thousand to 198.544645449... and so on."

The first problem was an attempt to overcome the trouble of doing these tasks which would become impracticable for very large numbers, even with the help of calculators or computer. The reading of that book has also prompted me to write these programs to compute the Riemann's zeta funcion on various RPL calculators which work for complex arguments, albeit |Im(s)| being limited to values no greater than 10, for full accuracy. The odd-numbered chapters become become heavier and heavier (at least for me) past half of the book.

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:

\[\zeta \left ( -\frac{1}{2} \right )+n\left ( \frac{2\sqrt{n}}{3}+\frac{1}{2\sqrt{n}}+\frac{1}{24\sqrt{n^{3}}}-\frac{3}{8}\cdot \frac{1}{720\sqrt{n^{7}}}+\frac{35}{8}\cdot \frac{1}{40320\sqrt{n^{11}}}-\frac{31185}{128}\cdot \frac{1}{3628800\sqrt{n^{15}}}+\cdots \right )\]

By the time I posted my first WP 34s program, I had only the first three terms of the series. The sixth term doesn't help much for n = 1, but it of help as n gets larger:


---n----------------------Sum---------------------number of terms

0001-------1.000034781967089878427137719047395------------5
0001-------0.9999676432952148784271377190473951-----------6

0005-------8.382332349275680487306898205740514------------5
0005-------8.382332347354059569143016435388880------------6
actual:-----8.382332347441762038738308734446847

0700-------12359.86189681703238439605016939615------------5
0700-------12359.86189681703238439605014782688------------6
actual:-----12359.86189681703238439605014782693

My second program is flawed, that is, it's inaccurate for small arguments (I don't remember what I did).

Best regards,

Gerson.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: One-liner mini-challenge [HP-71B] - Gerson W. Barbosa - 04-20-2015 04:41 PM



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