problems 5 and 8

code for ProjectEuler problems 5 and 8