Post Reply 
Challenge: Generate 24 in the X register / display
09-08-2020, 03:09 PM
Post: #42
RE: Challenge: Generate 24 in the X register / display
.
Hi, Gene & all:

Quote:Challenge: Using a single digit repeated 3 and only 3 times, produce the number 24 in the X register


As no one has submitted a solution for the HP-71B (as if !), here's a generic one I've created for it:

      DISP USING "^,DD";(digit+digit)/digit,FACT(RES+RES)

                   24

Simple as it is, notice the following:

      - it meets all requirements but as the HP-71B doesn't have an "X register" it simply puts 24 in the display
      - it works in any FIX, SCI or whatever mode so it puts in the display 24, not 2.4000E1 or 24.00
      - it doesn't use any other numbers at all, nor any variables
      - as per the requirements, it works for digit = 1,2,3,..., 9, but also you can replace digit by most any number, be it Pi, Sqrt(5), e^Pi^Pi, ...-, except digit = 0
      - for digit = 0, substitute digit above by, say, EXP(digit) or COS(digit), and there you are.
      - also, RES+RES could be instead RES*RES, RES^RES, and other variants.

This solution can be adapted easily to most RPN models, for instance:

      digit, ENTER, digit, +, digit, / , x^2, FACT

Thanks for the challenge and best regards.
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Challenge: Generate 24 in the X register / display - Valentin Albillo - 09-08-2020 03:09 PM



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