Post Reply 
WP 34S mini-challenge
01-21-2014, 03:44 PM (This post was last modified: 01-21-2014 03:47 PM by Gerson W. Barbosa.)
Post: #27
RE: WP 34S mini-challenge
(01-21-2014 11:29 AM)Paul Dale Wrote:  I considered an integer mode solution too. The shortest I could come up with is:

Code:
        x²
        RCL+ L
        SR 01

Which is three steps. However, I figured decimal mode was wanted and proposed the alternative above which works for non-integer inputs. Sadly, I had an extra hour to think about this problem on my drive home today after an accident on the freeway Sad

I wouldn't be at all surprised if a four (or less) step solution was possible. The 34S has an (almost) insane number of functions and people on this forum are better at utilising the calculator than I. I consider this a good thing, of course Smile


- Pauli

In principle the mini-challenge is interested only in integer results ("It computes the sum of the first n natural numbers using Gauss's formula."). Of course if it gives valid results for real inputs, as does my original solution, yours and Didier's, so much the better. It is required that the calculator modes get back to the default settings (like DECM) when done, in case they're changed by the program. This would make for five steps (additional BASE 02 and DECM instructions), if DECM restored the original float numbers when switching back from BASE 02, of course.
If we are pleased with integer arguments only, then even an HP-42S is almost possible:

Code:

00 {14-Byte Prgm}
01 LBL "GS"
02 X^2
03 RCL+ ST L
04 ??                  ;  these are not the exclusive WP 34 instructions
05 ??                  ;  I've used, but would be kind of a spoiler to the
06 ??                  ;  original solution in case they were disclosed
07 END

100000 XEQ GS --> 5000050000

but

50000 XEQ GS --> 1250024999 (too bad this error of 1 unit due to rounding error)

Cheers,

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


Messages In This Thread
WP 34S mini-challenge - Gerson W. Barbosa - 01-21-2014, 02:02 AM
RE: WP 34S mini-challenge - Paul Dale - 01-21-2014, 07:29 AM
RE: WP 34S mini-challenge - walter b - 01-21-2014, 07:59 AM
RE: WP 34S mini-challenge - walter b - 01-21-2014, 08:26 AM
RE: WP 34S mini-challenge - Paul Dale - 01-21-2014, 11:34 AM
RE: WP 34S mini-challenge - walter b - 01-21-2014, 12:20 PM
RE: WP 34S mini-challenge - Paul Dale - 01-21-2014, 11:51 AM
RE: WP 34S mini-challenge - walter b - 01-21-2014, 12:24 PM
RE: WP 34S mini-challenge - walter b - 01-21-2014, 11:08 AM
RE: WP 34S mini-challenge - Paul Dale - 01-21-2014, 08:24 AM
RE: WP 34S mini-challenge - Paul Dale - 01-21-2014, 11:29 AM
RE: WP 34S mini-challenge - Gerson W. Barbosa - 01-21-2014 03:44 PM
RE: WP 34S mini-challenge - nsg - 01-21-2014, 10:46 PM
RE: WP 34S mini-challenge - Dieter - 01-22-2014, 01:12 PM
RE: WP 34S mini-challenge - Paul Dale - 01-21-2014, 11:55 AM
RE: WP 34S mini-challenge - walter b - 01-21-2014, 12:29 PM
RE: WP 34S mini-challenge - walter b - 01-21-2014, 01:20 PM
RE: WP 34S mini-challenge - Paul Dale - 01-21-2014, 11:48 AM
RE: WP 34S mini-challenge - Dieter - 01-21-2014, 08:43 PM
RE: WP 34S mini-challenge - Paul Dale - 01-21-2014, 10:13 PM
RE: WP 34S mini-challenge - walter b - 01-22-2014, 05:15 AM
RE: WP 34S mini-challenge - Thomas Klemm - 01-22-2014, 05:47 AM
RE: WP 34S mini-challenge - walter b - 01-22-2014, 07:04 AM
RE: WP 34S mini-challenge - walter b - 01-22-2014, 08:16 AM
RE: WP 34S mini-challenge - Thomas Klemm - 01-22-2014, 06:02 AM
RE: WP 34S mini-challenge - Dieter - 01-22-2014, 01:20 PM
RE: WP 34S mini-challenge - Thomas Klemm - 01-22-2014, 06:35 PM
RE: WP 34S mini-challenge - Dieter - 01-22-2014, 08:27 PM



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