ruby: 05 using built in lcm and brute force