Fibonacci sequence: Difference between revisions

Content deleted Content added
pl:
add scheme code; In geometry,
Line 1:
[[pl:Funkcja Fibonacciego]]
 
TheIn [[geometry]], the '''Fibonacci numbers''' form a [[sequence]] defined [[recursion definition|recursively]] by the following equations:
 
: ''F''(0) = 0
Line 65:
 
where the normal Fibonacci sequence is the special case of ''P'' = ''Q'' = 1. Another kind of Lucas Sequence begins with ''L''(0) = 2, ''L''(1) = ''P''. Such sequences have applications in number theory and [[Prime number|primality]] proving.
 
=== Algorithm ===
Fibonacci numbers can be calculated by following [[Scheme programming language|Scheme]] code:
<pre>
(define fab
(lambda (x)
(if (< x 2)
x
(+ (fab (- x 1)) (fab (- x 2))))))
</pre>