HP 25 Fibonacci sequence in one program step
10-16-2021, 02:55 PM (This post was last modified: 10-16-2021 03:00 PM by Gerson W. Barbosa.)
Post: #24
 Gerson W. Barbosa Senior Member Posts: 1,584 Joined: Dec 2013
RE: HP 25 Fibonacci sequence in one program step
(10-13-2021 08:34 PM)rprosperi Wrote:  Many other models support recall arithmetic (45, 27, 15C, 32S, 32SII, others?) but only the 42S includes recall arithmetic AND stack register access.

Since we’re at it, I decided to write an HP-42S program to display the Fibonacci sequence trying to use the least number of steps (Not sure whether I’ve succeeded or not – another one I tried has exactly the same number of steps and bytes). Interestingly an equivalent HP-15C program, which lacks recall stack arithmetic but does have recall arithmetic, is possible using the same number of steps (8).

Code:
 00 { 20-Byte Prgm } 01▸LBL "Fib" 02 2 03 -1 04 + 05▸LBL 00 06 RCL+ ST L 07 STOP 08 GTO 00 09 END

XEQ “Fib” → 0
R/S → 1
R/S → 1
R/S → 2
R/S → 3
R/S → 5
R/S → 8
 « Next Oldest | Next Newest »

 Messages In This Thread HP 25 Fibonacci sequence in one program step - Dave Britten - 10-13-2021, 01:03 PM RE: HP 25 Fibonacci sequence in one program step - rprosperi - 10-13-2021, 01:23 PM RE: HP 25 Fibonacci sequence in one program step - Joe Horn - 10-13-2021, 02:02 PM RE: HP 25 Fibonacci sequence in one program step - Dave Britten - 10-13-2021, 02:19 PM RE: HP 25 Fibonacci sequence in one program step - Joe Horn - 10-13-2021, 02:36 PM RE: HP 25 Fibonacci sequence in one program step - Paul Dale - 10-13-2021, 01:30 PM RE: HP 25 Fibonacci sequence in one program step - Valentin Albillo - 10-13-2021, 02:30 PM RE: HP 25 Fibonacci sequence in one program step - Dave Britten - 10-13-2021, 02:43 PM RE: HP 25 Fibonacci sequence in one program step - C.Ret - 10-13-2021, 04:00 PM RE: HP 25 Fibonacci sequence in one program step - Gerson W. Barbosa - 10-13-2021, 04:42 PM RE: HP 25 Fibonacci sequence in one program step - Dave Britten - 10-13-2021, 06:26 PM RE: HP 25 Fibonacci sequence in one program step - Mike T. - 10-13-2021, 11:34 PM RE: HP 25 Fibonacci sequence in one program step - David Hayden - 10-13-2021, 06:53 PM RE: HP 25 Fibonacci sequence in one program step - Gerson W. Barbosa - 10-13-2021, 07:11 PM RE: HP 25 Fibonacci sequence in one program step - David Hayden - 10-13-2021, 07:35 PM RE: HP 25 Fibonacci sequence in one program step - Dave Britten - 10-13-2021, 07:47 PM RE: HP 25 Fibonacci sequence in one program step - C.Ret - 10-14-2021, 10:03 AM RE: HP 25 Fibonacci sequence in one program step - Albert Chan - 10-14-2021, 02:13 PM RE: HP 25 Fibonacci sequence in one program step - rprosperi - 10-14-2021, 07:04 PM RE: HP 25 Fibonacci sequence in one program step - rprosperi - 10-13-2021, 08:34 PM RE: HP 25 Fibonacci sequence in one program step - Didier Lachieze - 10-13-2021, 10:07 PM RE: HP 25 Fibonacci sequence in one program step - rprosperi - 10-14-2021, 01:27 AM RE: HP 25 Fibonacci sequence in one program step - Gerson W. Barbosa - 10-14-2021, 03:45 AM RE: HP 25 Fibonacci sequence in one program step - Gerson W. Barbosa - 10-16-2021 02:55 PM RE: HP 25 Fibonacci sequence in one program step - Gerson W. Barbosa - 10-17-2021, 02:17 PM

User(s) browsing this thread: