HP Forums

Full Version: (38G) Fibonacci Numbers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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):
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:
Reference URL's