euler prob 7, also rewrote 3 after reading 7 and realizing I'd been overcomplicating things