euler: Add problem 40

Signed-off-by: Aleksi Pitkäjärvi <aleksi.pitkajarvi@valotrading.com>