aboutsummaryrefslogtreecommitdiff
path: root/problem25.erl
blob: 8b89b8db41ba1c766b8d3fef12f82f2f8d34423c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-module(problem25).
-export([solve/0]).

solve() ->
	fibdigits(1000, 2, 1, 1).

fibdigits(N, M, A, B) ->
	L = length(integer_to_list(A)),
	if
		L =:= N ->
			M;
		true ->
			fibdigits(N, M+1, A+B, A)
	end.