Fibonacci sequence: Difference between revisions

Add TI SR-56 solution
(Add TI SR-56 solution)
Line 12,652:
}
}</syntaxhighlight>
 
=={{header|TI SR-56}}==
 
{| class="wikitable"
|+ Texas Instruments SR-56 Program Listing for "Fibonacci Sequence"
|-
! Display !! Key !! Display !! Key !! Display !! Key !! Display !! Key
|-
| 00 33 || STO || 25 || || 50 || || 75 ||
|-
| 01 00 || 0 || 26 || || 51 || || 76 ||
|-
| 02 01 || 1 || 27 || || 52 || || 77 ||
|-
| 03 33 || STO || 28 || || 53 || || 78 ||
|-
| 04 01 || 1 || 29 || || 54 || || 79 ||
|-
| 05 00 || 0 || 30 || || 55 || || 80 ||
|-
| 06 84 || + || 31 || || 56 || || 81 ||
|-
| 07 39 || *EXC || 32 || || 57 || || 82 ||
|-
| 08 01 || 1 || 33 || || 58 || || 83 ||
|-
| 09 94 || = || 34 || || 59 || || 84 ||
|-
| 10 27 || *dsz || 35 || || 60 || || 85 ||
|-
| 11 00 || 0 || 36 || || 61 || || 86 ||
|-
| 12 06 || 6 || 37 || || 62 || || 87 ||
|-
| 13 41 || R/S || 38 || || 63 || || 88 ||
|-
| 14 22 || GTO || 39 || || 64 || || 89 ||
|-
| 15 00 || 0 || 40 || || 65 || || 90 ||
|-
| 16 06 || 6 || 41 || || 66 || || 91 ||
|-
| 17 || || 42 || || 67 || || 92 ||
|-
| 18 || || 43 || || 68 || || 93 ||
|-
| 19 || || 44 || || 69 || || 94 ||
|-
| 20 || || 45 || || 70 || || 95 ||
|-
| 21 || || 46 || || 71 || || 96 ||
|-
| 22 || || 47 || || 72 || || 97 ||
|-
| 23 || || 48 || || 73 || || 98 ||
|-
| 24 || || 49 || || 74 || || 99 ||
|}
 
Asterisk denotes 2nd function key.
 
{| class="wikitable"
|+ Register allocation
|-
| 0: Nth term requested || 1: Last term || 2: Unused || 3: Unused || 4: Unused
|-
| 5: Unused || 6: Unused || 7: Unused || 8: Unused || 9: Unused
|}
 
Annotated listing:
<syntaxhighlight lang="text">
STO 0 // Nth term requested := User input
1 STO 1 // Last term := 1
0 // Initial value: 0
+ *EXC 1 = // Calculate next term.
*dsz 0 6 // Loop while R0 positive
R/S // Done, show answer
GTO 0 6 // If user hits R/S calculate next term
</syntaxhighlight>
 
'''Usage:'''
 
At the keypad enter a number N, then press RST R/S to calculate and display the Nth Fibonacci number. R/S for the following numbers.
 
{{in}}
<pre>1 RST R/S</pre>
 
{{out}}
<pre>1</pre>
 
{{in}}
<pre>2 RST R/S</pre>
 
{{out}}
<pre>1</pre>
 
{{in}}
<pre>3 RST R/S</pre>
 
{{out}}
<pre>2</pre>
 
{{in}}
<pre>10 RST R/S</pre>
 
{{out}}
<pre>55</pre>
<pre>R/S -> 89</pre>
<pre>R/S -> 144</pre>
 
=={{header|TI-83 BASIC}}==
27

edits