/** This is a solver for Rosetta Code problem: Proper Divisors https://rosettacode.org/wiki/Proper_divisors */ for n = 1 to 10 println["$n\t" + join[" ", properDivisors[n]]] println[] d = new dict for n = 1 to 20000 { c = length[properDivisors[n]] d.addToList[c, n] } most = max[keys[d]] println[d@most + " have $most factors"] properDivisors[n] := allFactors[n, true, false, true]