▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
Try to write a 10step program on the HP12C (final GTO 00 doesn't count) that displays, and keeps displaying, the socalled Gelfond's Constant, that is, e^{pi} = 23.14069264 (the value we get on all scientific Voyagers) or 23.14069263 (better 10digit result).
Paul Dale has already two solutions based on his 9step sequences for pi in a former thread, so the challenge will consist in finding as many 10step sequences as possible.
Besides Paul Dale's solutions below, there are at least five other 10step solutions for 23.14069264 . Of course one single 9step (or less) solution will supersede them all.
8 e^{x} 1 4 8  8 9 %T e^{x}
8 e^{x} 5 e^{x} INTG  8 9 %T e^{x}
Gerson.
▼
Posts: 1,755
Threads: 112
Joined: Jan 2005
Hi, Gerson:
Related to your HP12C minichallenge, there's a way to get e^{Pi} in an HP15C without using neither e^{x} nor Pi, in just 6 steps.
As for your HP12C challenge, the extremely simple:
10691
ENTER
462
/
courtesy of my IDENTIFY HP71B program is just 10 steps long and returns 23.14069264, as required.
Best regards from V.
Edited: 22 Oct 2009, 7:01 a.m.
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
Hi Valentin,
Quote:
As for your HP12C challenge, the extremely simple:
10691
ENTER
462
/
Yes, you have found one of them. There are at least three more variants of this one which fit in ten steps, and a very different one I came up with.
Thanks for your participation!
Best regards,
Gerson.
Posts: 2,761
Threads: 100
Joined: Jul 2005
Quote:
Related to your HP12C minichallenge, there's a way to get e^{Pi} in an HP15C without using neither e^{x} nor Pi, in just 6 steps.
If e^{x} is allowed, it can be done in 5 steps:
1
CHS
ENTER
Re<>Im
y^{x}
Best regards,
Gerson.
Edited: 22 Oct 2009, 8:10 a.m.
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
Quote:
If e^{x} is allowed,
Somehow I mistook y^{x} for e^{x}. So it was already there, in just 5 steps!
Posts: 104
Threads: 0
Joined: Dec 2007
Trivially from Valentin's solution:
21382
ENTER
924
/
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
I had missed that one, but it should count, so now we have eight 10steps solutions. If we multiply e^{pi} by 14 we get 323.969696859, which is surprisingly close to 323 ^{32}/_{33} (32.96969696...) or 10691/14, which divided by 14 is equivalent to Valentin's solution, 10691/462 (and your trivial solution, of course :)
This rational approximation allows for solutions like
3 2 4 ENTER 3 3 1/x  1 4 /
but it is not short enough for our purpose (but you can try one of your trivial solutions on this one ;)
Edited: 22 Oct 2009, 7:55 p.m.
Posts: 104
Threads: 0
Joined: Dec 2007
Trivially from my solution from Valentin's solution:
21382
ENTER
77
/
12/ (the single function under the "i" key)
Posts: 104
Threads: 0
Joined: Dec 2007
And another realization:
21382
12/ (the single function under the "i" key)
77
/
Giving the solution in 9 steps.
Edited:
I just realized that on the original HP12C the "12/" function does NOT fix the resulting number on the stack (enable stack lift?) ready for the 77 above. So it doesn't work without the extra ENTER.
On my HP12C platinum it DOES enable stack lift and works as I expected it to. Interesting. So just an unsatisfying solution that works for some models.
Edited: 23 Oct 2009, 3:58 p.m.
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
Quote:
I just realized that on the original HP12C the "12/" function does NOT fix the resulting number on the stack (enable stack lift?) ready for the 77 above. So it doesn't work without the extra ENTER.
I had noticed this too but I didn't know it would work on the 12C Platinum because I don't have one. Looks like this is an old bug that has been corrected on the 12C Platinum. Both my 12C (CN04808261) and 12C+ (CNA 83816873) have the same behavior. Anyway, your 9step solution is a record, albeit it works only on the Platinum. The solution in your previous post was on my list, so we have now eight 10step solutions that work on any 12C plus one 9step solution that works only on the 12C Platinum. The list is growing...
Gerson.
_{
Edited to correct a typo}
Edited: 23 Oct 2009, 4:47 p.m.
Posts: 2,761
Threads: 100
Joined: Jul 2005
Hi Valentin,
Quote:
Related to your HP12C minichallenge, there's a way to get e^{Pi} in an HP15C without using neither e^{x} nor Pi, in just 6 steps.
Indeed:
1
Re<>Im
ENTER
y^{x}
1/x
x^{2}
If at least pi were allowed it would have been possible in 5 steps:
pi
SINH
LSTx
COSH
+
Regards,
Gerson.
Posts: 1,792
Threads: 62
Joined: Jan 2005
Quote:
... Gelfond's Constant, that is, e^{pi} = 23.14069264 (the value we get on all scientific Voyagers) or 23.14069263 (better 10digit result)
Ah, but this minor flaw need not be accepted. It is possible to honestly calculate Gelfond's Constant to full 10digit accuracy on any scientific Voyager without resorting to elaborate multiprecision methods or unorthodox techniques. It is, um, "EZ".
The problem, of course, is that pi is returned to only 10 digits, compromising the accuracy of the exponential calculation. Utilizing
sin (pi  x) = sin x ~= x (for very small x)
e^(x + y) = e^x * e^y
First, obtain several extra digits of pi that are correct after rounding, and incorporate them into the latter of two parts of the input argument for the exponential, which is then evaluated separately and recombined:
FIX 9
RAD
pi
1E9

ENTER
SIN
x<>y
3.1

LASTx
e^x
R_down
+
e^x
R_up (or three R_down on the HP10C)
*
answer = 23.14069263
Subtracting 1E9 yields the first 10 correct digits of pi, so that the two calculated digits are the correct rounded digits of pi. This subtraction is not absolutely necessary.
OK, I didn't say that it was worth doing, just that it was possible...
BTW, clicking your "Gelfond's Constant" link reveals a "GelfondSchneider Constant". I cannot truthfully claim any credit...
;)
 KS
Edited: 23 Oct 2009, 1:56 a.m.
▼
Posts: 1,755
Threads: 112
Joined: Jan 2005
Karl posted:
"BTW, clicking your "Gelfond's Constant" link reveals a "GelfondSchneider Constant". I cannot truthfully claim any credit ... "
I fed its 12digit value ( 2.66514414268 ) to my IDENTIFY program but it duly returned 2^{Sqrt(2)} so no joy.
Best regards from V.
Posts: 2,761
Threads: 100
Joined: Jul 2005
Quote:
answer = 23.14069263
That's indeed the correct 10digit answer, but how can we be so sure? The problem doesn't lie on your method, which is absolutely corret, but on the calculator itself as there is no warranty all ten significant digits returned by transcedental functions are always correct (even though most of times they are). We can try, for instance,
keystroke display
pi 3.141592654
3 3
/ 1.047197551
e^x 2.849653908 ; can we trust this final 8?
3 3
y^x 23.14069263 ; if not, how can we trust this final 3?
and still don't be sure of the result. However, your endeavoring to be accurate is quite appreciated.
Regards,
Gerson.

Correction:
I had forgotten to take into account the guarddigits. By redoing your procedure on a 12digit calculator (to simulate the guarddigits when applied), I see we can take for granted your 10digit answer is really exact:
RAD
pi 3.141592654
1E9 1E9
 3.141592653
ENTER 3.141592653
SIN 5.9E10
x<>y 3.141592653
3.1 3.1
 0.041592653
LASTx 3.1
e^x 22.1979512814 ; e^3.1
22.19795128 ; rounded to 10 digits of the display
R_down 0.041592653
+ 0.04159265359
e^x 1.04246974594 ; e^0.04159265359
1.042469746 ; rounded to 10 digits of the display
R_up (or three R_down on the HP10C) 22.19795128 ;
23.1406926326 ; 22.19795128 * 1.042469746
23.14069263 ; correct rounded 10digit answer
Sorry for the mistake!
Edited: 23 Oct 2009, 8:19 p.m.
▼
Posts: 1,792
Threads: 62
Joined: Jan 2005
Gerson 
Thanks for going through my calculation stepbystep, illustratively. I hadn't actually done so, but knew that the answer was correct, and believed that it was not a coincidence, because two extra digits of pi were utilized.
The point of it was really the basic mathematical formulae, significant digits, and a simple application thereof.
The method doesn't buy any extra accuracy for 12digit inputs and three guard digits, because the 12digit 'best' value of pi, 3.14159265359, is already quite close to the 15digit 'best' value 3.14159265358979.
If the exact answer were not readily available (as in the notsoold days), it could be reasonably inferred, without absolute certainty, by interpolation from adjacent 10digit inputs that 23.14069263 is the closest 10digit result for e^pi:
pi e^pi
3.141592653 23.14069262
3.141592654 23.14069264
3.14159265359 23.1406926328
 KS
Edited: 24 Oct 2009, 3:30 a.m.
Posts: 3,229
Threads: 42
Joined: Jul 2006
Two possible nine step solutions for the 12cp:
4 x^2 7 . 7 y^x 6 * LN
8 x^2 5 . 3 y^x 3 * LN
Both unrelated to the existing solutions. Are these related to the very different one Gerson mentioned? Replacing the x^2 with ENTER * making them ten steps and suitable for the 12c of course.
 Pauli
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
Quote:
Are these related to the very different one Gerson mentioned?
You have found another different family that gives the best 10digit answer and includes at least a couple of 9step solutions that will work on ALL 12C versions.
Your solutions can be rewritten for two more 10step solutions:
6 LN 16 LN 7.7 * +
3 LN 64 LN 5.3 * +
Regards,
Gerson.
Posts: 2,761
Threads: 100
Joined: Jul 2005
Despite e^{pi} is not so appealing as pi and other more widely known mathematical constants this minichallenge has elicited interesting and insightful responses. Thanks to all participants!
Here is a compilation of all available solutions so far:
10step solutions
8 e^{x} 1 4 8  8 9 %T e^{x} (Paul Dale)
8 e^{x} 5 e^{x} INTG  8 9 %T e^{x} (Paul Dale)
8 7 8 LN 1 6 * ENTER LN / (Gerson W. Barbosa)
1 6 2 ENTER 6 6 1/x  7 /
1 0 6 9 1 ENTER 4 6 2 / (Valentin Albillo)
2 1 3 8 2 ENTER 9 2 4 / (Steve Perkins)
2 1 3 8 2 ENTER 7 7 / 12/
6 5 ENTER 4 6 2 / 2 3 +
4 ENTER * 7 . 7 y^{x} 6 * LN (Paul Dale)
8 ENTER * 5 . 3 y^{x} 3 * LN (Paul Dale)
9step solutions (12CP only)
2 1 3 8 2 12/ 7 7 / (Steve Perkins)
4 x^{2} 7 . 7 y^{x} 6 * LN (Paul Dale)
8 x^{2} 5 . 3 y^{x} 3 * LN (Paul Dale)
Gerson.
Edited: 26 Oct 2009, 11:19 a.m.
▼
Posts: 3,229
Threads: 42
Joined: Jul 2006
Nice collection of solutions and a fun challenge.
I'd be a little surprised if there weren't quite a few more ten step solutions to this. Finding them is the difficult part. Still, nobody found the elusive nine step solution if such exists.
 Pauli
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
Quote:
I'd be a little surprised if there weren't quite a few more ten step solutions to this.
There are at least two more of them, actually just a rewriting of your own, see my reply to your post above.
Quote:
Still, nobody found the elusive nine step solution if such exists.
There are at least a couple of 9step solutions that will work on the 12C as well, both based on yours.
Gerson.
Edited: 26 Oct 2009, 5:32 p.m.
▼
Posts: 3,229
Threads: 42
Joined: Jul 2006
These two nine step solutions are an obvious continuation of my previous:
2 n! 2 9 . 8 y^x 12x LN
4 INTG 1 4 . 9 y^x 12x LN
I think these two are nicer:
2 LN 8 EXP INTG % EXP 12x LN
8 EXP INTG 2 LN % EXP 12x LN
 Pauli
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
Quote:
2 n! 2 9 . 8 y^x 12x LN
4 INTG 1 4 . 9 y^x 12x LN
Congratulations! Exactly what I had derived from yours, by solving LN(12*4^X)=EXP(PI) and LN(12*2^X)=EXP(PI) for X on the 33s:
4 ENTER 1 4 . 9 y^{x} 12* LN
2 ENTER 2 9 . 8 y^{x} 12* LN
Equivalent expressions could also have been found by hand, as in
6*16^{7.7} = 6*16^{77/10} = 12*1/2*xroot(10,16^{77}) = 12*xroot(10,16^{77}/2^{10}) = 12*xroot(10,2^{308}/2^{10}) = 12*xroot(10,2^{298}) = 12*2^{29.8}
but it was way easier with the SOLVER :)
LN(12*16^X)=EXP(PI) and LN(12*32^X)=EXP(PI) give two more 10step solutions (plenty of them by now!).
Quote:
I think these two are nicer:
2 LN 8 EXP INTG % EXP 12x LN
8 EXP INTG 2 LN % EXP 12x LN
I wonder how many more 9step solutions there are!
Regards,
Gerson.
Edited: 26 Oct 2009, 9:18 p.m.
▼
Posts: 3,229
Threads: 42
Joined: Jul 2006
Quote: I wonder how many more 9step solutions there are!
Forget the 9step solutions. Is there an eight?
I suspect not but would like to be proved wrong.
 Pauli
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
I wish there were something as simple as
2 1 ENTER sqrt sqrt +
Anyway not so bad, considering just six keystrokes for the first seven digits and the decimal point...
Gerson.
Posts: 3,229
Threads: 42
Joined: Jul 2006
Can anyone do likewise for pi^e = 22.459157718361...
My 15c gives 22.45915771 for this. Correctly rounded it should be 22.45915772.
So, what can people find for the 12c?
Currently, I've no better solution than the obvious type in the number. However, I'm sure someone can do better than 11 operations.
 Pauli
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
1 5 7 sqrt . 5 5 7 9 /
> 22.45915772
Gerson.
Edited: 27 Oct 2009, 12:57 p.m.
▼
Posts: 1,792
Threads: 62
Joined: Jan 2005
A year or two ago, a Forum participant offered a small "challenge" of sorts for young math students: Knowing that pi and e were both near 3 in magnitude, and pi > e, how would one go about deducing whether e^pi or pi^e had the greater value, without actually calculating them?
Here's a straightforward approach I think most of us would follow:
e^pi ? pi^e
ln (e^pi) ? ln (pi^e)
pi ? e * ln (pi)
e * (pi/e) ? e * ln (pi)
Because to raise e to a given higher value requires a greater multiplier than exponent, pi/e > ln (pi).
Applying this from the bottom upwards, we conclude that e^pi > pi^e.
12digit answers:
e^pi = 23.1406926328
pi^e = 22.4591577184
e^pi is only about 3% greater than pi^e.
Similar, simpler numbers:
2^3 = 8
3^2 = 9
but
3^4 = 81
4^3 = 64
Paul Dale posted:
Quote:
Can anyone do likewise for pi^e = 22.459157718361...
My 15c gives 22.45915771 for this. Correctly rounded it should be 22.45915772.
If anyone can present a reasonablystraightforward way to obtain this actual value of pi^e to ten digits on a preSaturn HP, I'd like to see it, because I'm stumped...
On an HP42S with both pi and e rounded to nine decimal digits (10 significant digits), pi^e = 22.4591577145, so it appears that the HP15C's result is the best possible, given its limitations.
 KS
Edited: 1 Nov 2009, 3:48 p.m. after one or more responses were posted
▼
Posts: 3,229
Threads: 42
Joined: Jul 2006
This little puzzle was the inspiration for my follow up challenge.
I've seen it a number of times over the years and I think it is one of the gems of mathematics.
 Pauli
Posts: 3,229
Threads: 42
Joined: Jul 2006
Here are two nine step solutions to the pi^e variation. Both give the correctly rounded result as required.
.0788 LN 25 +
25 EXP 7.88 % LN
Yes, they are essentially the same. The 12cp has at least three more variations on these two by utilising 5 x^2 instead of 25 and commutating the addition.
 Pauli
Edited: 6 Nov 2009, 7:17 a.m. after one or more responses were posted
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
Quote:
.0788 LN 25 +
Nice one!
My 10step solution was found with help a tiny 12c program. I started with n=500 and manually checked sqrt(n)/pi^e for interesting answers as n decreased by one unit. The Turbo Pascal code below tries to automate the process. I tried other functions but didn't find anything better. I quit!
Gerson.

_{ } Program Ep;
var n: integer;
d: array[1..9] of byte;
m: array[0..9] of byte;
g,i,j,r: byte;
k,f,x: real;
begin
ReadLn(k,r);
n:=1500;
repeat
x:=sqrt(n)/k;
f:=frac(x);
m[0]:=0;
for i:=1 to 9 do
begin
f:=10*f;
d[i]:=trunc(f);
f:=frac(f);
m[i]:=0
end;
for i:=0 to 9 do
for j:=1 to 9 do
if d[j]=i then
m[i]:=m[i]+1;
g:=m[0];
for i:=1 to 9 do
if m[i]>g then
g:=m[i];
if g>r1 then WriteLn(n:4,' ',x:12:10);
n:=n1
until n=1
end.
22.459157718 5
1418 1.6766586370
1413 1.6736999994
1346 1.6335373355
1236 1.5653655450
1181 1.5301411115
1051 1.4434704347
1009 1.4143344442
804 1.2625092229
754 1.2226220048
628 1.1157999996
625 1.1131316817
610 1.0996929796
596 1.0870003024
211 0.6467668658
189 0.6121212228
157 0.5578999998 > pi^{e} ~ sqrt(157)/0.5579
