Post Reply 
(38G) Fibonacci Numbers
04-06-2015, 11:19 AM (This post was last modified: 06-15-2017 01:56 PM by Gene.)
Post: #1
(38G) Fibonacci Numbers
Two programmes:

FIBO takes non-negative integer input N & returns the Nth Fibonacci number in Ans, exact for N < 60.

FIBO

ROUND(((1+√5)/2)^Ans/√5,0)-(Ans>55)-(Ans>57)*2-(Ans>58)*2:

FIBO? takes non-negative integer input N & returns 1 if N is a Fibonacci number, else 0, correct for N < 447214.

FIBO?

5*Ans^2+4:
IFTE(FRAC(√Ans),IFTE(FRAC(√(Ans-8)),0,1),1):
Find all posts by this user
Quote this message in a reply
04-28-2015, 05:52 AM
Post: #2
RE: HP 38G: Fibonacci Numbers
You can put the formula in the Sequence Aplet using the programme FIBOSEQ.

U2 gives the partial sums of the Fibonacci series.

FIBOSEQ

RUN SEQSET:
RECURSE(U,ROUND(((1+√5)/2)^N/√5,0)-(N>55)-(N>57)*2-(N>58)*2,1,1)►U1(N):
CHECK 1:
RECURSE(U,U1(N+2)-1,1,2)►U2(N):
CHECK 2:
Find all posts by this user
Quote this message in a reply
Post Reply 




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