solved euler23; extremely inefficient and should be cut down on time