first attempt at Project Euler Q2