Post Reply 
Fibonacci numbers without programming
09-20-2017, 03:13 PM
Post: #1
Fibonacci numbers without programming
Amazingly, most of simple non-scientific calculators allow to produce sequence of Fibonacci numbers with only 2 key press per number:

AC 1 + = + = + = ...

On HP 17b I found solutions with 6 keys per number:
For init: 0 ENTER 1 ENTER
Next number: SHIFT LAST + SHIFT LAST =

How to do this on RPN calculators like HP 12C, HP 42S (without programming)?
Find all posts by this user
Quote this message in a reply
09-20-2017, 03:51 PM
Post: #2
RE: Fibonacci numbers without programming
With a RPN calculator you can do:
Code:
1 ENTER 1 + LASTx x<>y + LASTx x<>y + ...
Find all posts by this user
Quote this message in a reply
09-20-2017, 04:11 PM
Post: #3
RE: Fibonacci numbers without programming
It worked. Good solution.
Thanks you!
Find all posts by this user
Quote this message in a reply
09-20-2017, 05:03 PM (This post was last modified: 09-20-2017 05:03 PM by Dieter.)
Post: #4
RE: Fibonacci numbers without programming
(09-20-2017 03:13 PM)stored Wrote:  How to do this on RPN calculators like HP 12C, HP 42S (without programming)?

On calculators with RCL-arithmetics and direct stack access (e.g. the 42s) you can do this:

1 ENTER +
RCL+ ST L
RCL+ ST L
RCL+ ST L
...

Depending on the model this may take the same four keys as the Lastx x<>y + method... or maybe less: on the WP31s and 34s it's simply [RCL] [+] [L].

Dieter
Find all posts by this user
Quote this message in a reply
09-20-2017, 07:41 PM
Post: #5
RE: Fibonacci numbers without programming
On the RPL series, if you enter two 1's on the stack, the sequence OVER OVER + will fill the stack with the Fibonacci series. Three key presses if you have the PROGRAM/STACK menu active.

John
Find all posts by this user
Quote this message in a reply
09-20-2017, 08:34 PM
Post: #6
RE: Fibonacci numbers without programming
(09-20-2017 07:41 PM)John Keith Wrote:  On the RPL series, if you enter two 1's on the stack, the sequence OVER OVER + will fill the stack with the Fibonacci series. Three key presses if you have the PROGRAM/STACK menu active.

Or two, if you do DUP2 + instead.

Gerson.
Find all posts by this user
Quote this message in a reply
09-20-2017, 08:55 PM
Post: #7
RE: Fibonacci numbers without programming
Any blind programmable CASIO:

Code:
[1][KIN][1]
Then repeat the following:
Code:
[+][x↔K1][=]

Csaba
Find all posts by this user
Quote this message in a reply
09-20-2017, 09:54 PM
Post: #8
RE: Fibonacci numbers without programming
If you have a matrix math capable calculator, fill the stack with:
[[1 1]
[1 0]]

and press "X" (multiply) repeatedly. A one button solution!
Visit this user's website Find all posts by this user
Quote this message in a reply
09-20-2017, 10:05 PM
Post: #9
RE: Fibonacci numbers without programming
(09-20-2017 08:34 PM)Gerson W. Barbosa Wrote:  
(09-20-2017 07:41 PM)John Keith Wrote:  On the RPL series, if you enter two 1's on the stack, the sequence OVER OVER + will fill the stack with the Fibonacci series. Three key presses if you have the PROGRAM/STACK menu active.

Or two, if you do DUP2 + instead.

Gerson.

DOH! That's what I get for posting first, thinking later. :-)
Find all posts by this user
Quote this message in a reply
09-20-2017, 10:38 PM
Post: #10
RE: Fibonacci numbers without programming
(09-20-2017 09:54 PM)Jim Horn Wrote:  If you have a matrix math capable calculator... A one button solution!

What I really like about this solution is that it does not rely at all on the coeffificents in the recursion being 1 or on the order of the recursion being only 2. That's the difference between doing math and doing arithmetic :-)
Find all posts by this user
Quote this message in a reply
09-20-2017, 10:40 PM (This post was last modified: 09-20-2017 10:46 PM by Gerson W. Barbosa.)
Post: #11
RE: Fibonacci numbers without programming
(09-20-2017 10:05 PM)John Keith Wrote:  
(09-20-2017 08:34 PM)Gerson W. Barbosa Wrote:  Or two, if you do DUP2 + instead.

Gerson.

DOH! That's what I get for posting first, thinking later. :-)

I have many “OVER OVER” sequences permanently written in the files, like this one here (third code box in post #20). Yet DUP2 was available in my first RPL calculator, a 28S. Hopefully I’ll never forget :-)
Find all posts by this user
Quote this message in a reply
09-20-2017, 11:18 PM
Post: #12
RE: Fibonacci numbers without programming
(09-20-2017 09:54 PM)Jim Horn Wrote:  If you have a matrix math capable calculator, .... A one button solution!
I really like this one: so general. The difference between doing math and arithmetic :-)
Find all posts by this user
Quote this message in a reply
09-20-2017, 11:53 PM
Post: #13
RE: Fibonacci numbers without programming
(09-20-2017 05:03 PM)Dieter Wrote:  On calculators with RCL-arithmetics and direct stack access (e.g. the 42s) you can do this:

1 ENTER +
RCL+ ST L
RCL+ ST L
RCL+ ST L
...

On calculators with STO arithmetics and direct stack access -- like the HP41 -- you may proceed as follows:
Code:
start sequence
1  ENTER

iterate sequence
ST+ Y  X<>Y
By 'synthetic programming' you may assign the ST+ Y to a key adjacent to the X<>Y key, so the iteration will just be two key press.
Without 'synthetic programming' I would enter ST+ Y X<>Y as a program (formaly it is a program, but with only two instructions it is of cause not at all) so after the start sequence you would just press R/S as often as needed.

Ciao.....MIke
Find all posts by this user
Quote this message in a reply
Post Reply 




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