Sunday, September 14, 2025

RPN HP 12C: Fibonacci and Lucas Sequences

 RPN HP 12C: Fibonacci and Lucas Sequences



Golden Ratio, Formulas, and Sequences


Let φ be the Golden Ratio:

φ = (1 + √5) ÷ 2


Formulas and Sequences


Fibonacci Numbers:

Fn = (φ^n - (-φ)^-n) ÷ √5


F0 = 0

F1 = 1

F2 = 1

F3 = 2

F4 = 3

F5 = 5

F6 = 8

F7 = 13

F8 = 21

F9 = 34

F10 = 55


Lucas Numbers:

Ln = φ^n + (-1)^n × (1 ÷ φ^n)


P0 = 2

P1 = 1

P2 = 3

P3 = 4

P4 = 7

P5 = 11

P6 = 18

P7 = 29

P8 = 47

P9 = 76

P10 = 123


HP 12C Code: Fibonacci and Lucas Numbers


Stack: X: n


01:[    44, 1]: STO 1

02:[        1]: 1

03:[    44, 0]: STO 0

04:[        5]: 5

05:[   43, 21]: √

06:[44, 40, 0]: STO+ 0

07:[        2]: 2

08:[44, 10, 0]: STO÷ 0 // Golden Ratio


09:[    45, 0]: RCL 0

10:[    45, 1]: RCL 1

11:[       21]: y^x

12:[    44, 2]: STO 2

13:[    44, 3]: STO 3

14:[    45, 0]: RCL 0

15:[       16]: CHS

16:[    45, 1]: RCL 1

17:[       16]: CHS

18:[       21]: y^x

19:[44, 30, 2]: STO- 2

20:[        5]: 5

21:[   43, 21]: √

22:[44, 10, 2]: STO÷ 2

23:[    45, 2]: RCL 2

24:[       31]: R/S // Fibonacci Numbers


25:[        1]: 1

26:[       16]: CHS

27:[    45, 1]: RCL 1

28:[       21]: y^x

29:[    45, 3]: RCL 3

30:[       22]: 1/x

31:[       20]: ×

32:[44, 40, 3]: STO+ 3

33:[    45, 3]: RCL 3

34:[43, 33, 00]: GTO 00



Variables:

R0 = φ

R1 = n

R2 = Fn

R3 = Ln


Sources


"Generalizations of Fibonacci numbers". Wikipedia. https://en.wikipedia.org/wiki/Generalizations_of_Fibonacci_numbers#Fibonacci_integer_sequences Last Edited October 6, 2024. Accessed June 18, 2025


Olson, Scott. The Golden Section: Nature Greatest Secret. Wooden Books. Bloomsbury. New York, NY and London, UK. 2006. ISBN 978-0-8027-1539-5



Eddie


All original content copyright, © 2011-2025. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

The author does not use AI engines and never will.

RPN HP 12C: Fibonacci and Lucas Sequences

  RPN HP 12C: Fibonacci and Lucas Sequences Golden Ratio, Formulas, and Sequences Let φ be the Golden Ratio: φ = (1 + √5) ÷ 2...