Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function F_recursive($n){
- static $K;
- if($n<=1) {
- return 1;
- } elseif (!isset($K[$n]) || $K[$n] == 0) {
- $K[$n]=F_recursive($n-1) + F_recursive($n-2);
- }
- return $K[$n];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement