Blatantly copy negativek's project euler1 solution.