Ruby function to find numbers whose sum of squares of divisors is a perfect square
You don't need to call to_a.  Ranges are directly Enumerable.

Divisors always occur in pairs.  You don't need to test (1..i/2); you only need to go up to \$\sqrt{i}\$.

For fast performance, though, you would need a solution based on number theory rather than brute-force enumeration.