This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
project-euler/e0006/euler0006.jl
2017-07-12 00:33:48 +02:00

17 lines
217 B
Julia

#/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)