More a curiosity than a challenge...



#3

Hi;

One curiosity (or chalenge): given three numbers A, B and C in the stack (X-, Y- and Z- registers) what's the shortest way to get (A+B+C), A, B and C in any order in the stack by using only the stack registers and stack manipulations?

Before   After  or     or    or...

X A A A+B+C A
Y B B A A+B+C
Z C C B -
T - A+B+C - C

L - - C B

I know an easy way with the HP42S:

ENTER
RCL - ST Z
RCL - ST T

or in an HP41:

ENTER
R^ (ROLL-UP)
ST+ Y
R^ (ROLL-UP)
ST+ Z

but I would like to know the shortest way to do it in, say, a Voyager, or in an HP32SII, or in an HP12C. Restrictions are the calculator's resources themselves. Any clues?

This is intented to activate some stand-by, RPN-mode, stack-simulation areas of contributors' brains. And, of course, I want to know a better, shortest way to do it.

Hope you like it.

Luiz C. Vieira - Brazil


#4

Hi;

the HP42S procedure is:

ENTER
RCL + ST Z
RCL + ST T

Forgive me!

Luiz C. Vieira - Brazil


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime CAS curiosity bluesun08 11 952 12-10-2013, 01:03 PM
Last Post: Han
  HP Prime Matrices curiosity bluesun08 0 249 12-09-2013, 06:44 PM
Last Post: bluesun08
  Another Prime curiosity Michael de Estrada 0 190 11-05-2013, 11:52 AM
Last Post: Michael de Estrada
  HP-80 CHS Exponent Curiosity Max Stone 4 459 10-22-2013, 02:39 PM
Last Post: Max Stone
  WP34s curiosity... Stephan Matthys 7 500 08-24-2013, 10:40 PM
Last Post: Dale Reed
  HP-34C Curiosity Matt Agajanian 7 566 08-23-2013, 06:02 PM
Last Post: Stephan Matthys
  Little curiosity: why the fourth stack register is called "T"? Antlab 34 1,756 07-03-2013, 04:49 PM
Last Post: Walter B
  Sting curiosity Alberto Fenini 12 681 07-01-2010, 11:01 AM
Last Post: Michael Meyer
  Out of curiosity, HP calculators in movies or TV series? hecube 6 424 09-09-2009, 06:53 AM
Last Post: Klaus
  hyperbolic curiosity Bill Triplett 48 2,510 10-20-2008, 02:28 AM
Last Post: Rodger Rosenbaum

Forum Jump: