42.4242424242



#11

In case you're wondering about the title, this is kind of a little challenge: try to find the shortest RPN keystroke sequence that makes the 42S display 42.4242424242, assuming the display mode is STD or at least FIX 10. Simply keying the number in would require 13 keystrokes, so only solutions up to 12 keystrokes would count. I have found a 7-keystroke sequence which has the additional advantage to be almost universal: if your calculator of choice is the HP-41 you'd be able to use the same number of keystrokes to display 41.41414141 on it. And so to display 15.15151515 on your 15C, and 12.12121212 on your 12C, and so on.

A variation would be considering the calculator in its initial power-on state. In the case of the HP-41 it defaults to FIX 4. So we'd like to display 41.4141 instead as shift FIX 9 would require three more keystrokes, which would spoil the fun. Of course displaying 41.4141 would require at least 8 keystrokes (ENTER is needed to hide the cursor). Interesting solutions should have 7 keystrokes at most. For instance, the 5-keystroke sequence 2 SQRT 40 +would be a nice solution if it returned 41.4141 rather than 41.4142.

I came across the more general solution in less than ten minutes, which makes me guess this is a very easy challenge after all (or I was just lucky). The other solutions might be more interesting in case you're willing to try (so far I don't have any).

Best regards,

Gerson.


#12

Quote:
In case you're wondering about the title, this is kind of a little challenge: try to find the shortest RPN keystroke sequence that makes the 42S display 42.4242424242, assuming the display mode is STD or at least FIX 10.

.99 1/x 42 *
is seven keystrokes on a HP-42S. It also generalises to other calculators as mentinoed.


- Pauli


#13

Congratulations! Really easy, isn't it?

Indeed, it can be solved in less than one minute, as I had just checked:

      x =   42.4242...
100 * x = 4242.4242...
----------------------
99 * x = 4242 - 42

99 * x = 4200

x = 4200/99

x = 42/.99

x = 1/.99 * 42

As I said, the second part should be more interesting for some models.

Best regards,

Gerson.


#14

I didn't attack it quite that way. I knew 1/9 and 1/11 and similar had "interesting" decimal expansions so I typed in 1.0101010101... and pressed 1/x.


- Pauli

#15

Just a variant ...

1
Enter
%
-
1/x
*

Edited: 18 Sept 2006, 11:58 p.m.


#16

Really interesting!

I have also liked very much your general solution to Paul Dale's overflow challenge.

Best regards,

Gerson.


#17

Thanks, Gerson!

I appreciate your feedback very much.

#18

Contrary to what I thought some particular cases don't present any trouble at all:

10C: .099 1/x (5 keystrokes)
11C: .09 1/x (4 keystrokes)
15C: .066 1/x (5 keystrokes)

and so on...

Edited: 18 Sept 2006, 12:31 a.m.


#19

It was not very difficult, but it was funny! Thanks for posting.


#20

I'm glad you liked it. But definitely that was not so funny...
The 1<>2 toggle problem was much better:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv015.cgi?read=74095


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP-67's Flag 3 to HP-41/42 Equivalent Matt Agajanian 2 402 03-29-2012, 06:29 AM
Last Post: Dieter
  HP 82240B. Infra red printer for HP 42---HP 50g Stuart Sprott 20 1,614 04-29-2010, 01:52 PM
Last Post: Vieira, Luiz C. (Brazil)
  HP41/42 Unit Conversion Egan Ford 36 2,676 03-30-2009, 11:30 AM
Last Post: Martin Pinckney
  Need help transitioning from 41/42 to 33/35 Bill Colisch 2 356 10-13-2007, 12:27 PM
Last Post: Bill Colisch
  Microchallenge 41/42: nr of digits Werner 3 489 09-14-2007, 04:35 PM
Last Post: Howard Owen
  HP-97 and HP-42 Gerry Schultz 4 563 06-06-2007, 10:54 AM
Last Post: Jim Creybohm
  Key Sounds in a 42 Ron 5 618 01-03-2007, 10:07 AM
Last Post: Ron
  Emu48 1.42 and WINE - It Works! Howard Owen 0 195 09-02-2006, 10:21 PM
Last Post: Howard Owen
  HP42S program (Survey-Quik Calc 42) K Kelley 2 378 08-26-2006, 10:48 PM
Last Post: Todd
  HP 42 manual for Free42 Alister 1 328 10-05-2005, 07:51 AM
Last Post: Jeff O.

Forum Jump: