### The Maxima on-line user's manual

Algebra Calculator

#### Fib

Function: fib (<n>) Returns the <n>th Fibonacci number. `fib(0)` equal to 0 and `fib(1)` equal to 1, and `fib (-<n>)` equal to `(-1)^(<n> + 1) * fib(<n>)`.

After calling `fib`, `prevfib` is equal to `fib (<x> - 1)`, the Fibonacci number preceding the last one computed.

```          (%i1) map (fib, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
(%o1)         [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]```

There are also some inexact matches for `fib`. Try `?? fib` to see them.

```(%o1)                                true
(%i2) ```

### Related Examples

##### fib-sqrt

fib(n):=(%phi^n-(-%ph...

Calculate

##### fib

n:0;

fib(n);

F(n):= n-2 + n-1;

Calculate

fib(7);

Calculate

fib(0);

fib(1);

fib(2);

Calculate

fib(80);

Calculate

##### fib

for n:0 thru 20 do sp...

for n:0 thru 22 do (...

Calculate

##### fib-fibtophi

f(x,y,z):=5*fib(x)*fi...

f(10,20,15);

fibtophi(fib(x+y-z));

Calculate

##### fib-float-makelist

makelist(fib(i), i, 1...

float(123/2);

Calculate

##### fib-makelist

makelist(fib(i), i, 1...

Calculate

##### fib-fibtophi

f(x,y,z):=5*fib(x)*fi...

f(10,20,15);

fibtophi(fib(x+y-z));

Calculate