 (11C) Tribonacci Sequence - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (11C) Tribonacci Sequence (/thread-9698.html) (11C) Tribonacci Sequence - Gamo - 12-14-2017 12:21 PM The Tribonacci Sequence is a generalization of the Fibonacci sequence where each term is the sum of the three preceding terms. The sequence begins 0, 1, 1, 2, 4, 7, 13, 24, 44, 81, 149,. . . . Input the Nth number Example: 7 A result 24 _______10 A result 149 Code: ``` LBL A STO 0 19  ENTER 33 √ 3 x -  3 1/X Y^X STO 1 33 √ 3 x 19 + 3 1/X Y^X STO 2 + 1 + 3 1/X x RCL 0 Y^X STO 3 RCL 1 RCL 2 + 1 + 4 ENTER 3 / x RCL 1 RCL 2 + 1 + X^2 9 1/X x - 1 - STO 4 RCL 3 RCL 4 / FIX 0 RTN``` Gamo RE: (11C) Tribonacci Sequence - Dieter - 12-14-2017 09:34 PM (12-14-2017 12:21 PM)Gamo Wrote:  The Tribonacci Sequence is a generalization of the Fibonacci sequence where each term is the sum of the three preceding terms. The sequence begins 0, 1, 1, 2, 4, 7, 13, 24, 44, 81, 149,. . . . Input the Nth number Example: 7 A result 24 _______10 A result 149 Interesting formula. But implemented waaayyy too complicated. ;-) Actually it's nothing more than u · vn with u and v being two constants. So what about this one: Code: ```LBL C ENTER 1,839286755 STO 0 x<>y y^x RCL 0 4 x RCL 0 x^2 - 1 - / ,4 + INT RTN``` Or simply... Code: ```LBL C ENTER 1,839286755 x<>y y^x ,336228117 x ,4 + INT RTN``` Dieter RE: (11C) Tribonacci Sequence - StephenG1CMZ - 12-15-2017 12:03 AM I am a little confused as to how a tribonacci sequence can be a generalisation of a Fibonacci - though to be fair Wikipedia also uses that terminology. I'd have thought a tribonacci would be a variation, but an n-bonacci capable of handling any number of summations would be a generalisation. But my main reason for posting isn't to quibble, but to enquire. I always find it helpful to think of applications to help focus upon the maths. Fibonacci always makes me think of rabbits, though I am sure that is not it's only use. Does the Tribonacci sequence have any practical use? RE: (11C) Tribonacci Sequence - Gamo - 12-15-2017 03:23 AM Here is the detail on Phi and Tribonacci on YouTube. https://youtu.be/e7SnRPubg-g Gamo