Proper divisors: Difference between revisions

m
→‎{{header|Sidef}}: modified the code to work with Sidef 2.30
m (→‎{{header|Sidef}}: modified the code to work with Sidef 2.30)
Line 2,516:
divs << 1 if (x > 1)
 
for d in (2 ..^ x.isqrt) {
var y = (x // d)
if (y*d == x) {
Line 2,527:
}
 
10.times { |i| say "#{i}\t#{propdiv(i).dump}" }
 
var max = 0
var candidates = []
20_000.times { |i|
for i in (1 ..^ 20_000) {
var divs = propdiv(i).len
if (divs > max) {
Line 2,540:
}
 
say "max = #{max}, candidates = #{candidates.dump}"</lang>
{{out}}
<pre>
2,747

edits