Last active
May 12, 2020 02:17
-
-
Save sushant12/af80670e7923f43c7e8d0dbe37d82c6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(assignment3). | |
-export([fib/1, pieces/1]). | |
fib(0) -> | |
0; | |
fib(1) -> | |
1; | |
fib(N) when N > 1 -> | |
fib(N - 2) + fib(N - 1). | |
pieces(1) -> | |
2; | |
pieces(N) when N > 0 -> | |
pieces(N-1) + N. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment