Euler C solution to problem #19