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)