aboutsummaryrefslogtreecommitdiff
path: root/problem40.erl
diff options
context:
space:
mode:
authorNathan Lasseter <nathan.je.lasseter@googlemail.com>2009-10-04 00:56:56 +0100
committerNathan Lasseter <nathan.je.lasseter@googlemail.com>2009-10-04 00:56:56 +0100
commit0248ed34ce3d05228bc5084669c3a27933be0c2e (patch)
treeb9c4990344b0863a2af851b5917c49f3a5f03e6b /problem40.erl
parent00686037d57eb0a0d5eba6eeb6fcc9692e8b59f6 (diff)
first commit
Diffstat (limited to 'problem40.erl')
-rwxr-xr-xproblem40.erl11
1 files changed, 11 insertions, 0 deletions
diff --git a/problem40.erl b/problem40.erl
new file mode 100755
index 0000000..d2299af
--- /dev/null
+++ b/problem40.erl
@@ -0,0 +1,11 @@
+-module(problem40).
+-export([solve/0]).
+-import(lists,[nth/2,flatten/1,map/2,seq/2]).
+
+solve() ->
+ N = onenum(),
+ t(1,N)*t(10,N)*t(100,N)*t(1000,N)*t(10000,N)*t(100000,N)*t(1000000,N).
+
+onenum() -> flatten(map(fun(X) -> integer_to_list(X) end, seq(1,400000))).
+
+t(N,L) -> nth(N,L) - 48.