Post Reply 
Musings on the HP-70
12-29-2023, 12:53 PM (This post was last modified: 12-30-2023 08:54 AM by Thomas Klemm.)
Post: #2
RE: Musings on the HP-70
Here's another one:



Euler's number

Initialisation

DSP 9
-1
STO K
13
STO M
1
ENTER
ENTER
ENTER

Loop

K
M+
รท
+

Result

1.000000000
1.083333333
1.098484848
1.109848485
1.123316498
1.140414562
1.162916366
1.193819394
1.238763879
1.309690970
1.436563657
1.718281828
2.718281828


Explanation

\(
\begin{aligned}
e
&= 1+{\frac {1}{1}}+{\frac {1}{1\cdot 2}}+{\frac {1}{1\cdot 2\cdot 3}}+\cdots \\
&= 1 + \frac{1}{1}\left(1 + \frac{1}{2}\left(1 + \frac{1}{3}\left(1 + \cdots \right) \right) \right) \\
\end{aligned}
\)

Python Program

Code:
s = 0
for k in range(13, 0, -1):
    s = 1 + s / k
    print(f"{s:>.9f}")

References


I hope you realise in time when you have to stop.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Musings on the HP-70 - Thomas Klemm - 12-29-2023, 10:35 AM
RE: Musings on the HP-70 - Thomas Klemm - 12-29-2023 12:53 PM
RE: Musings on the HP-70 - Thomas Klemm - 12-30-2023, 09:02 AM



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