This calculates the sum up to 500000 in 1m17s. Better, not great.