completing problem #2 on euler