solved euler 52, decent runtime