The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

Another not quite PI puzzle
Message #1 Posted by Paul Dale on 6 Nov 2006, 2:54 a.m.

Things are quiet, too quiet. Time for another little puzzle :-)

You just keyed in "g PI" into your trusty 15c when you realise that you wanted the digits in reverse order. How to best get there?

I.e. the X register contains PI, the calculator is in FIX 4 mode and you want to see 6.1413 in the minimum number of operations. Assume nothing else.

Clearly, this can be done in six: 6 . 1 4 1 3 (digit entry being acceptable after the g PI sequence). Can you do it in fewer than six?

- Pauli

      
Re: Another not quite PI puzzle
Message #2 Posted by Paul Dale on 6 Nov 2006, 9:54 p.m.,
in response to message #1 by Paul Dale

A fair portion of a day and no comments :-( Oh well, I'll post my best then. Two separate solutions that are almost the same:

    4 ->DEG + ASINH
    4 ->DEG + ACOSH

- Pauli

            
Re: Another not quite PI puzzle
Message #3 Posted by Gerson W. Barbosa on 7 Nov 2006, 6:57 p.m.,
in response to message #2 by Paul Dale

The best I've been able to find are these two useless 6-step solutions:

      3 + 8 CHS ex -      (10C, 11C, 12C, 15C)

12x SQRT 6 n! 1/x + (12C)

Do you want all digits in reverse order?

      13 ENTER .652 / ex 40.1 +       

Ok, to be useful this had to be four steps shorter...

Gerson.

                  
Re: Another not quite PI puzzle
Message #4 Posted by Paul Dale on 7 Nov 2006, 7:23 p.m.,
in response to message #3 by Gerson W. Barbosa

Quote:
Do you want all digits in reverse order?

      13 ENTER .652 / ex 40.1 +       

Ok, to be useful this had to be four steps shorter...


Very nice! I didn't ask for all the digits but this is still classy even though it is longer.

I did find some five step solutions to the original problem too:

    INT COSH 6 1 %
    LN ->RAD SQRT 6 +
    5 TANH * 3 +
    5 TANH 3 * +

- Pauli

                        
Re: Another not quite PI puzzle
Message #5 Posted by Gerson W. Barbosa on 7 Nov 2006, 7:50 p.m.,
in response to message #4 by Paul Dale

Quote:
I did find some five step solutions to the original problem

I did find one too, if you allow me a little cheating:

9.02 1/x - x! ->HMS
Five steps... on the HP-32SII... :-)

An even longer solution to the second problem:

1460081 ENTER 9990 / 4 yx 1.5 - 

Gerson.

Edited: 7 Nov 2006, 7:58 p.m.

                        
Re: Another not quite PI puzzle
Message #6 Posted by Gerson W. Barbosa on 7 Nov 2006, 8:39 p.m.,
in response to message #4 by Paul Dale

Quote:
this is still classy even though it is longer.

Let's give it a (fake) serious look by rewriting it as

'EXP((5*SQRT(130)/SQRT(163))^2) + 355/10' (This works on the HP-15C, the HP-34C and on the HP-41CX)

You can notice SQRT(163) which appears in some pi series expansions and 355, the numerator in the well known rational approximation for pi, 355/113 :-)

Gerson.

Edited: 7 Nov 2006, 8:45 p.m.

                  
Re: Another not quite PI puzzle
Message #7 Posted by Antonio Maschio (Italy) on 8 Nov 2006, 3:14 a.m.,
in response to message #3 by Gerson W. Barbosa

Gerson wrote:

Quote:
Do you want all digits in reverse order?

13 ENTER .652 / ex 40.1 +

Ok, to be useful this had to be four steps shorter...


Curiously I tried, in FIX 4, the same sequence on a 12C, a 32SII and a Casio fx-180P; here are the results:

12C     456295141.3
32SII   456295139.830
fx-180P 456295139.5

What about it? I'll try on other calculators I got, you could do the same. If so, what are your results?

To me, the problem seems to be related to the exp calculation.

-- Antonio

                        
Re: Another not quite PI puzzle
Message #8 Posted by Gerson W. Barbosa on 8 Nov 2006, 6:53 a.m.,
in response to message #7 by Antonio Maschio (Italy)

Quote:
To me, the problem seems to be related to the exp calculation

You are right. The accuracy of this function varies on different calculators. You should adjust the last term (40.1). For instance, on the 42/48/49/50G it should be 41.524, or 10*SQRT(569/33), if you prefer it so.

Of course, for the full twelve reversed digits on these calculators, another expression has yet to be found.

Gerson.

------

Is your message having been posted exactly at 3:14 a.m. a coincidence? :-)

------

On the HP-71B (with Math ROM) and HP-50G:

    GAMMA(COSH(10/3)+7347/7348)-318/5     =>   95356295141.3
On the HP-32SII:
10 ENTER 3 / COSH 7348 1/x - x! 63.6 -    =>   95356295141.3

Edited: 8 Nov 2006, 4:04 p.m.

                              
Re: Another not quite PI puzzle
Message #9 Posted by Palmer O. Hanson, Jr. on 8 Nov 2006, 9:36 p.m.,
in response to message #8 by Gerson W. Barbosa

To get all ten digits on the HP-67, HP-41, HP-12C and HP 33S try the fraction

254599 ENTER 55797 /

which is thirteen steps.

                                    
As The Little Kid Said:
Message #10 Posted by Trent Moseley on 8 Nov 2006, 11:51 p.m.,
in response to message #9 by Palmer O. Hanson, Jr.

I'm tired of pi I want to eat some e.

tm

                                    
Re: Another not quite PI puzzle
Message #11 Posted by Gerson W. Barbosa on 9 Nov 2006, 9:51 a.m.,
in response to message #9 by Palmer O. Hanson, Jr.

Quote:
254599 ENTER 55797 /

This is better than

564793 ENTER 123778 /   (fourteen steps)
However, we want a fully reversed pi approximation, 456295141.3
1368885424 ENTER 3 /    (thirteen steps)
Is there something shorter than the eleven steps required to simply keying the number in?

--------------

5475541696  12/         (eleven steps on the HP-12C)

Edited: 9 Nov 2006, 10:02 a.m.

                                          
Re: Another not quite PI puzzle
Message #12 Posted by Palmer O. Hanson, Jr. on 9 Nov 2006, 9:04 p.m.,
in response to message #11 by Gerson W. Barbosa

To reverse twelve digits of pi, but not fully reverse them, try

2060907 ENTER 216127 /

This works on my HP-28S and my hp 33s. It also works on my TI-85.

                                          
Re: Another not quite PI puzzle
Message #13 Posted by Paul Dale on 9 Nov 2006, 10:50 p.m.,
in response to message #11 by Gerson W. Barbosa

I've got a 12 step solution that assumes DEG mode has been set:

    7 PI % 10^x + 10^x 3 5 ->RAD ACOS ->DEG -

I can do a 12 step that gives negative the reversed digits of PI without this assumption:

    7 SQRT 8 2 delta% 7 PI % 10^x + 10^x -

Of course both utilise PI :-)

- Pauli

Edited: 10 Nov 2006, 1:19 a.m. after one or more responses were posted

                                                
Re: Another not quite PI puzzle
Message #14 Posted by Paul Dale on 9 Nov 2006, 10:56 p.m.,
in response to message #13 by Paul Dale

I spoke too soon. Here is a 12 step solution that doesn't assume anything (trig mode, digit entry, stack contents or even complex mode):

    PI ASINH ACOSH 9 5 y^x 2 3 ACOSH 7 y^x +

Still one step shy of equalling the number of steps used to just enter the number...

- Pauli

                                                      
Re: Another not quite PI puzzle
Message #15 Posted by Gerson W. Barbosa on 10 Nov 2006, 7:23 p.m.,
in response to message #14 by Paul Dale

Quote:
PI ASINH ACOSH 9 5 y^x 2 3 ACOSH 7 y^x +

Nice one! You're always two steps ahead. It seems I cannot find anything better than 14-step solutions:

     6 2 3 ENTER 5 2 / x! 9 4 0 . 6 -

1 CHS ->RAD 7 5 + SQRT 10^x 4 9 2 . 4 -

Gerson.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall