scipy stuff and projectr euler 19