Euler project 24