euler project ruby solution