function p6()
sum(1:100)^2 - sum((1:100).^2)
end;
p6()
25164150
function p6()
sum(1:100)^2 - sum((1:100).^2)
end;
p6()
25164150
using BenchmarkTools;
@benchmark p6()
BenchmarkTools.Trial: 10000 samples with 983 evaluations. Range (min … max): 41.003 ns … 1.133 μs ┊ GC (min … max): 0.00% … 83.55% Time (median): 84.259 ns ┊ GC (median): 0.00% Time (mean ± σ): 104.053 ns ± 88.673 ns ┊ GC (mean ± σ): 10.16% ± 10.64% █▇▆▅▄▂▂ ▂ ▅▅███████████▇▇▇▆▆▅▅▄▅▄▃▁▁▁▁▁▁▃▁▁▁▁▁▁▁▁▁▁▁▁▁▃▃▃▃▄▅▄▄▄▆▅▆▆▇▆▅ █ 41 ns Histogram: log(frequency) by time 689 ns < Memory estimate: 896 bytes, allocs estimate: 1.