Top
Back: factorial
Forward: kmemory
FastBack: compregb_lib
FastForward: inout_lib
Up: general_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.2.3.7 fibonacci

Procedure from library general.lib (see general_lib).

Usage:
fibonacci(n); n,p integers

Return:
fibonacci(n): nth Fibonacci number, f(0)=f(1)=1, f(i+1)=f(i-1)+f(i)
- computed in characteristic 0, of type bigint

Example:
 
LIB "general.lib";
fibonacci(42); "";             //f(42) of type string (as long integer)
ring r = 2,x,dp;
number b = fibonacci(42,2);    //f(42) of type number, computed in r
b;
prime


Top Back: factorial Forward: kmemory FastBack: compregb_lib FastForward: inout_lib Up: general_lib Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 3-0-4, Nov 2007, generated by texi2html.