solved euler 45, not the fastest script, but not pure brute force