Post Reply 
One-liner mini-challenge [HP-71B]
04-17-2015, 01:46 PM (This post was last modified: 04-17-2015 07:19 PM by Gerson W. Barbosa.)
Post: #12
RE: One-liner mini-challenge [HP-71B]
Perhaps this is a more interesting problem:

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

And here is a simple WP 34s solution:

Code:

001 LBL A
002 RCL+ X
003 STO+ X
004 ENTER^
005 INC X
006 INC X
007 INC X
008 STO* Y
009 Rv
010 INC X
011 RCL L
012 sqrt
013 /
014 # 024
015 /
016 # 1/2
017 +/-
018 zeta
019 +
020 END

100 A --> 671.462947108

This of course will fit in one HP-71B programming line, but I'll leave that as an exercise for the reader :-)

Gerson.


P.S.: Slightly more accurate:

Code:


001 LBL A
002 FILL
003 3
004 y^x
005 sqrt
006 STO+ X
007 3
008 /
009 #003
010 #004
011 RCL* T
012 /
013 RCL* Y
014 # 015
015 R^
016 x^2
017 STO/ Y
018 x<> L
019 SDL 001
020 x<> L
021 STO+ X
022 RCL+ L
023 +
024 RCL/ Y
025 1/x
026 +
027 +
028 # 1/2
029 +/-
030 zeta
031 +
032 END

079 A --> 423.352471483
100 A --> 671.462947103

Obviously, no optimization attempts here.
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-17-2015 01:46 PM



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