Created
December 7, 2016 07:58
-
-
Save toddnestor/1505705513fe3b48dca3a8cae672aac4 to your computer and use it in GitHub Desktop.
Fibonaccie sequence in erlang
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(fibonacci). | |
-export([process/1]). | |
process(1) -> | |
[0]; | |
process(2) -> | |
[0,1]; | |
process(N) -> | |
lists:append(process(N - 1), [ lists:last(process(N - 1)) + lists:last(process(N - 2) ) ] ). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment