From 447f5ebd775a103eb612b5361520527eb3ae37a8 Mon Sep 17 00:00:00 2001 From: ikselven Date: Wed, 12 Jul 2017 00:33:48 +0200 Subject: [PATCH] added julia implementation for problem 6 --- e0006/euler0006.jl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 e0006/euler0006.jl diff --git a/e0006/euler0006.jl b/e0006/euler0006.jl new file mode 100644 index 0000000..6d02e7a --- /dev/null +++ b/e0006/euler0006.jl @@ -0,0 +1,17 @@ +#/usr/bin/julia + +function sumOfSquares(x) + sum(x.^2) +end + +function squareOfSum(x) + sum(x)^2 +end + +function euler0006(x) + seq=1:x + squareOfSum(seq) - sumOfSquares(seq) +end + +euler0006(1) +@time euler0006(100)