Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

the fibonacci sequence

int fabseq(int nth){
        if (nth == 1 || nth == 2){
            return 1;
        }
        int equ = (1/sqrt(5))*pow(((1+sqrt(5))/2), nth)-(1/sqrt(5))*pow((1-sqrt(5))/2, nth);
        return equ;
}
Source by www.mathsisfun.com #
 
PREVIOUS NEXT
Tagged: #fibonacci #sequence
ADD COMMENT
Topic
Name
4+6 =