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

solve() ->
	lists:sum(getlist()).

getlist() ->
	[X-48 || X <- integer_to_list(getnum())].
getnum() ->
	pow2(1000).

pow2(0) ->
	1;
pow2(X) ->
	2 * pow2(X-1).