Watch this Author's files
My hats off, John.
A three liner then, that will be fairly efficient.
f = x ./(1:ceil(sqrt(x)));
f = f(f==fix(f)).' ;
f = unique([f;x./f]);
For example, when x = 2^25, the two liner takes
Elapsed time is 114.624158 seconds.
While my three liner takes only
Elapsed time is 0.139695 seconds.
Nice two-liner, Jos.
But note that this entry has memory and speed advantages. Try a large number, like 2^25.