Most mindblowing program for your favorite calculator

07012022, 06:38 AM
Post: #21




RE: Most mindblowing program for your favorite calculator
(07012022 05:38 AM)pauln Wrote: The nonmod version of Euclid's algorithm is prohibitively slow but you cannot argue against the elegance of this 5step solution. Hi, if you read that REMARK under that magical 5 steps, you can realize, that 5 steps are truly 8 steps and you got totally same as my code, but there are people who wants became Neil Armstrong instead of Buzz Aldrin, but I'm Neil Armstrong And today I have a bad day, so... Cs. 

07012022, 07:01 AM
Post: #22




RE: Most mindblowing program for your favorite calculator
(07012022 06:23 AM)Csaba Tizedes Wrote: If you remove "LBL/RTN" and "GTO to first line" from my code, you got totally same... (06302022 07:34 AM)Csaba Tizedes Wrote: The "smallest but workable" is more hard task and required more effort to produce, I guess. Choose one or the other. To me it is surprising that it works at all. I stumbled upon this feature some time ago: HP15C Bug with MATRIX 5 

07012022, 07:42 AM
Post: #23




RE: Most mindblowing program for your favorite calculator
(07012022 07:01 AM)Thomas Klemm Wrote:(06302022 07:34 AM)Csaba Tizedes Wrote: The "smallest but workable" is more hard task and required more effort to produce, I guess. Because it was most clever response, than I expected, I'll be patient and I'll try to hide my Hungarian temperament... Cs. 

07012022, 08:07 AM
Post: #24




RE: Most mindblowing program for your favorite calculator
(07012022 05:38 AM)pauln Wrote: The nonmod version of Euclid's algorithm … This mod version program for the HP15C uses one register but only 8 steps: Code: 001  44 0 STO 0 Example CLEAR PRGM 112 ENTER 63 R/S R↓ 7.0000 You are free to add LBL, GTO, R↓ and RTN if you feel like this is cheating. 

07012022, 02:12 PM
(This post was last modified: 07012022 02:15 PM by Pälzer.)
Post: #25




RE: Most mindblowing program for your favorite calculator
I have a (probably stupid?) question about GCD calculation:
is such a calculation also possible with a solver like the HP17bII ? I'm not a programmer, mathematician or similar (see also signature) => it should be feasible, I have no idea how that should work? Edit: typo 8years elementary school, 2y business school; no bachelor/master, etc.; but always interested in simple mathematics & calculators 

07012022, 04:51 PM
Post: #26




RE: Most mindblowing program for your favorite calculator
(07012022 02:12 PM)Pälzer Wrote: I have a (probably stupid?) question about GCD calculation: Yes. Not a stupid question, it's not obvious how this might be done without some math background and experience using the Pioneer Solver. Download the "StepbyStep Solutions: Technical Applications (27S/19B)" manual here: https://literature.hpcalc.org/items/1143 and read the beginning of Chapter 2. Bob Prosperi 

07012022, 09:11 PM
Post: #27




RE: Most mindblowing program for your favorite calculator
(06182022 03:29 AM)Steve Simpkin Wrote: I had to create a table of elevations and compass headings used to aim a portable 5 foot satellite dish at the Galaxy II geostationary television satellite from about 200 latitude/longitude locations across north America. I obtained the required formulas from a library book, wrote the program, entered it into my HP25, plugged it into AC power and away I went. In the early 80's, I too made a program to locate geosynchronous satellites and find their Azimuth And Elevation. But for the 41C. I used the formulas form an old astronomy book. 

07012022, 10:06 PM
(This post was last modified: 07032022 01:32 PM by Thomas Klemm.)
Post: #28




RE: Most mindblowing program for your favorite calculator
(07012022 02:12 PM)Pälzer Wrote: is such a calculation also possible with a solver like the HP17bII ? I came up with the following equation: GCD:GCD=0×(A+B+Σ(I:1:LN(SQRT(5)×A)÷LN((SQRT(5)+1)÷2):1:IF(B<>0:L(R:MOD(A:B))+L(A:B)+L(B:G(R)):0)))+A To make it more readable we can format it like so: GCD:GCD=0×( A+B+Σ( I: 1: LN(SQRT(5)×A)÷LN((SQRT(5)+1)÷2): 1: IF(B<>0: L(R:MOD(A:B))+L(A:B)+L(B:G(R)): 0 ) ) ) +A We can use the Σ function instead of a forloop. But gcd is usually implemented with a whileloop: Code: def gcd(a, b): What should be used as limits in the forloop? Of course we could just loop from 1 to a. But can we do better? The worst case is to have two consecutive Fibonacci numbers. From this we can make a better estimate for the needed number of loops. There's a closed formula: \( F_{n}=\frac{\varphi^{n}\psi^{n}}{\sqrt {5}}, \) where \( \varphi = \frac{1+\sqrt{5}}{2}\approx 1.61803\,39887\ldots \) is the golden ratio, and \(\psi\) is its conjugate: \( \psi = \frac{1\sqrt {5}}{2}=1\varphi ={1 \over \varphi }\approx 0.61803\,39887\ldots . \) But for \(n\) big enough we can ignore \(\psi^{n}\) as it goes to \(0\). We end up with: \( a=\frac{\varphi^{n}}{\sqrt {5}}, \) This can be solved for \(n\): \( n = \frac{\log(\sqrt{5} a)}{\log(\varphi)} \) Only if \(B \ne 0\) the remainder \(R\) is calculated: IF(B<>0: L(R:MOD(A:B))+L(A:B)+L(B:G(R)): 0 ) The equivalent code in Python would be: Code: if b != 0: But we are not interested in that sum, but only in A. Thus the expression is multiplied by \(0\) and we end up with: GCD=0×(…)+A After verifying the equation you should end up with a menu like this: [ GCD ][ A ][ B ] Examples 112 A 63 B GCD CALCULATING... GCD=7 144 A 89 B GCD CALCULATING... GCD=1 

07022022, 01:48 AM
Post: #29




RE: Most mindblowing program for your favorite calculator
(07012022 07:42 AM)Csaba Tizedes Wrote: Because it was most clever response, than I expected, I'll be patient and I'll try to hide my Hungarian temperament... You mean you're not one of the Merry Magyars? Tom L Cui bono? 

07022022, 09:24 AM
Post: #30




RE: Most mindblowing program for your favorite calculator
@ rprosperi
@ Thomas Klemm Thank you very much for the answers. I didn't know until now that you can also include loops in an equation (in the solver). The manual of the HP17bII+ says nothing about it. So far I have only created short equations, like ... "Gross'Net: Gross = Net + (Net * ST% / 100)" [ GROSS ][ NET ][ ST% ] I briefly looked at pages 3235 of the "Technical App" = too difficult for me. I will deal with pages 1827 though, very interesting. After that I will read in detail the answer of Thomas. I don't have the mathematical background. Only had 2 years of "simple algebra" as an elective in school (alternatively: office technology/stenography). It was by chance that I had chosen "mathematics" ;) further question 1: is there a thread known which had the topic HP 17b/HP19b + Solver with explanations ? my search did not find anything, but I may have used the wrong search words. further question 2. is there an equation with loop that is "shorter" that I can look at Thank you for your patience with me (Translated) 8years elementary school, 2y business school; no bachelor/master, etc.; but always interested in simple mathematics & calculators 

07022022, 10:02 AM
(This post was last modified: 07032022 02:26 PM by Thomas Klemm.)
Post: #31




RE: Most mindblowing program for your favorite calculator
(07022022 09:24 AM)Pälzer Wrote: further question 1: These two just came to my mind: Meanwhile I also found these: In the attached PDF of the 2nd link on page 4 you can find a description How LET and GET Change an Equation. This let's us use the following formula iteratively to calculate the GCD: B=0×(L(R:MOD(A:G(B)))+L(A:G(B))+G(R) After verifying the equation you should end up with a menu like this: [ B ][ A ] After entering A and B just keep hitting the B key until the result is 0. The GCD can then be found in A. Example 112 A 63 B B CALCULATING... B=49 B CALCULATING... B=14 B CALCULATING... B=7 B CALCULATING... B=0 RCL A A=7 HTH 

07022022, 11:13 AM
(This post was last modified: 07022022 05:42 PM by jonmoore.)
Post: #32




RE: Most mindblowing program for your favorite calculator
Reading through this thread has reminded me of the classic 70's book Computational Analysis with the HP25 Pocket Calculator (Peter Henrici).
I was fortunate enough to pick up a digital version of this on my travels (print copies command a very high price) and it inspired many a routine on a variety of HP calculators. The link above provides a downloadable PDF copy of the book. As it happens, Peter Henrichi was responsible for a number of classic computational complex analysis books published by Wiley from the sixties through to the nineties. Three volumes with various reprints were published (due to their popularity), and he published another more general numerical analysis tome titled Elements of Numerical Analysis (Peter Henrici). This last link provides a downable version of the book in many formats via archive.org. It's surprisingly accessible, considering it was first published at a time when math textbooks were particularly inaccessible by modern pedagogic standards. 

07022022, 11:43 AM
Post: #33




RE: Most mindblowing program for your favorite calculator
(07022022 11:13 AM)jonmoore Wrote: Reading through this thread has reminded me of the classic 70's book Computational Analysis with the HP25 Pocket Calculator (Peter Henrici). Thank you or these I noticed that the book, Computational Analysis with the HP25 Pocket Calculator, came out in 1977, the same year I bought my HP25. 

07022022, 03:38 PM
Post: #34




RE: Most mindblowing program for your favorite calculator
(07022022 11:13 AM)jonmoore Wrote: Reading through this thread has reminded me of the classic 70's book Computational Analysis with the HP25 Pocket Calculator (Peter Henrici). Thanks for posting these. I've been tempted when seeing them on eBay, but always too much, just to have in case I find the time. Bob Prosperi 

07022022, 05:39 PM
Post: #35




RE: Most mindblowing program for your favorite calculator
(07022022 03:38 PM)rprosperi Wrote:(07022022 11:13 AM)jonmoore Wrote: Reading through this thread has reminded me of the classic 70's book Computational Analysis with the HP25 Pocket Calculator (Peter Henrici).r 1 ENTER + 

07032022, 08:36 AM
Post: #36




RE: Most mindblowing program for your favorite calculator
(07012022 04:51 PM)rprosperi Wrote: Download the "StepbyStep Solutions: Technical Applications (27S/19B)" manual here: I should have done that before implementing it myself. Quote:Of particular importance is a formula that gives the maximum number of divisions \(M\) needed to arrive at a zero remainder. This formula is given as: Let's see: \( \begin{align} \frac{1}{\log\left(\varphi\right)} \approx 2.07809 \end{align} \) So I assume the same reasoning is being used. Therefore, you rather use the formula from this manual. In addition to the GCD, you will also receive the LCM. Quote:Reference I don't have access to this book right now, but I'll check it out next week. 

07032022, 10:14 AM
(This post was last modified: 07032022 10:32 AM by xerxes.)
Post: #37




RE: Most mindblowing program for your favorite calculator
(06302022 05:22 PM)Dan C Wrote: Isnt the FX180P the same machine as the FX3600P, but in a different housing? Yes. I prefer the FX3900PV, because it has a nice editor and 300 steps in 4 areas. GCD on the FX180P: Code: 01 x<>y And just for fun, the factorial in 4 steps: Code: 01 Kin*1 Calculator Benchmark 

07032022, 12:42 PM
Post: #38




RE: Most mindblowing program for your favorite calculator
For me it would have to be the humongous Star Trek programs attempted on 70's era machines. "Star Trek Advanced" for the HP67 in 3D space no less. And the TI59 Star Trek game that took IIRC 13 mag cards and was essentially the same as the various Trek games in BASIC at the time.
Personally, I'm a strong proponent of 'use the right tool for the job' philosophy. So I never really saw these as more than just an intellectual exercise. If I wanted to write a similar program, I would have used MS BASIC on an Altair or something similar in those days. John 

07212022, 08:41 PM
Post: #39




RE: Most mindblowing program for your favorite calculator
Valentin's reversi (aka othello) for the 41C. It kicked my 17yearold butt when I first got it. I was so amazed by it's talent that I spent an evening going through the source code to figure out how it worked.


07232022, 12:49 AM
Post: #40




RE: Most mindblowing program for your favorite calculator
.
Hi, David, (07212022 08:41 PM)David Hayden Wrote: Valentin's reversi (aka othello) for the 41C. It kicked my 17yearold butt when I first got it. I was so amazed by it's talent that I spent an evening going through the source code to figure out how it worked. Thank you very much for your appreciation, I wasn't much older at the time I wrote it. For those interested, these are some relevant links (PDF documents): HP Program VA428  UPL PS  HP41C Othello (00903C) This is my original submittal to the HewlettPackard Users' Program Library (USA) of my HP41C program Othello at the request of HP UPL's Sandy Canning. Besides my original 15page submittal, I've also included here four pages of goodquality barcode to allow for fast, errorfree entry of the long program into the calculator using the wand. HP Article VA019  25 years of Othello 8page article to commemorate (2005) the 25th Anniversary of my HP41C "Othello"playing program. For those of you who feel nostalgic about the golden past of classic HP calculators, this article reminisces on those wonderful times back when the HP41C was brandnew and everything seemed possible and everyone was in awe at it. The article tells the whole story about how my HP41C "Othello" program came to be, with its downs and its ups (like being featured at the time in an issue of the "Wall Street Journal" magazine), and including previously unpublished letters sent from HP Corvallis to me ("The program has generated a lot of interest in our division"), asking me to submit it to the HP41C User's Library and awarding me a special "Certificate for Outstanding Contributions" in return. Also included is a recreation of the original HP41C "Othello" for the HP71B with a few minor improvements, which is a 43line program with full instructions and sample run so that you can test your wits playing this challenging 8x8 board game against it, to try and feel what HP41C users felt at the time when seeing it for the first time 25 years ago. HP Letter 19800801  Letter from Valentin Albillo to Richard Nelson This August 1980 9page letter I sent to Richard Nelson includes the very first version for any machine of my Othello program, which was a long, optimized, polished program which would play quite fast a nontrivial game against the user, optionally printing a nice labeled board if a printer was available. Despite there being nothing remotely like it at the time, to my utter disbelief it was never published in Mr. Nelson's PPC Calculator Journal, no reasons given whatsoever, so I wasted one full year waiting for its publication before ultimately getting fed up and looking for greener pastures. Thanks again, David, and best regards. V. All My Articles & other Materials here: Valentin Albillo's HP Collection 

« Next Oldest  Next Newest »

User(s) browsing this thread: