Post Reply 
HP 25 Fibonacci sequence in one program step
10-14-2021, 10:03 AM (This post was last modified: 10-14-2021 10:05 AM by C.Ret.)
Post: #21
RE: HP 25 Fibonacci sequence in one program step
(10-13-2021 04:42 PM)Gerson W. Barbosa Wrote:  RPN: Y, Z, T <- k1; X <-k2 Then * * * …
RPL: Fill the infinite stack with [ [ 1 1 ] [ 1 0 ] ] Then * * * …

[Image: c795926ab8f80e6207800de0451de69a69b8f641] and [Image: f90aae99d109a6d152d80d03d0353a5e849c560e]

Thank to remind me this old matrix arithmetic multiplication on RPL. I remember a few decade when I try to use power exponentiation of [[1 1][1 0]] to the n to directly get Fn value. Hard time discovering sadly that the matrix exponentiation on the HP-28C/S doesn't work with ^ instruction.

(10-13-2021 06:26 PM)Dave Britten Wrote:  I think you guys have figured out the gist of it.
The solution in the book is to set FIX 0, and fill the stack thusly:

T: phi
Z: phi
Y: phi
X: 1/SQRT(5)

Where phi is the golden ratio: (SQRT(5)+1)/2. The 1/SQRT(5) term is derived from Binet's formula.

OK, now I can publish my completed trace print.
[attachment=9914]


(10-13-2021 07:35 PM)David Hayden Wrote:  
(10-13-2021 07:11 PM)Gerson W. Barbosa Wrote:  0 1 + Then repeat RCL + ST L
That's it!

I can't applied this trick neither on my HP-41C that miss memory recall arithmetic, nor on my HP-15C who have recall arithmetic but no stack register manipulation.
The amazing HP 42S (or succedanea DM 42S or Free 42) is really a blend of the two anthology systems.

At least, like the HP-25, the HP-41 and HP-15C need a two steps naked program « LASTx + », close to a simple RPL code leaving the Fibonacci sequence reversed in the stack initiate by 1 DUP and repeating « OVER OVER + » over and over...
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 25 Fibonacci sequence in one program step - C.Ret - 10-14-2021 10:03 AM



User(s) browsing this thread: