Euler Problem 4 in C