The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Yet another Fibonacci mini-challenge (HP-42S/Free42)
12-05-2018, 12:59 AM
Post: #1
Yet another Fibonacci mini-challenge (HP-42S/Free42)
00 { 22-Byte Prgm }
01▸LBL "FIB"
02
03
04
05
06
07
08
09
10
11 END

11 XEQ FIB —> 89
50 XEQ FIB —> 12586269025


Write an HP-42S program that computes the nth Fibonacci number ( 0 < n < 51 ) using nine steps or less, not including LBL and END. Of course, for this mini-challenge byte-count is less relevant than number of steps.
My particular application requires n in the range from 1 to 20 at most, so the above routine is ok for me. However, programs that work for n = 0 up to the largest possible argument on both the HP-42S and Free42 are welcome as well, no matter if longer than nine or even nineteen steps.

Have fun!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Yet another Fibonacci mini-challenge (HP-42S/Free42) - Gerson W. Barbosa - 12-05-2018 12:59 AM



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