fib(A,B,C,_) when A == B -> C;<br>
fib(A,B,C,D) -> fib1(A,B+1,C+D,C). <br>
<br>
call it with<br>
<br>
fib(X,1,1,0).