24 lines
395 B
Text
24 lines
395 B
Text
print "The first 20 anti-primes are:"
|
|
|
|
while (count < 20)
|
|
n = n + 1
|
|
d = count_divisors(n)
|
|
if d > max_divisors then
|
|
print n;
|
|
max_divisors = d
|
|
count = count + 1
|
|
end if
|
|
wend
|
|
print
|
|
|
|
sub count_divisors(n)
|
|
local count, i
|
|
|
|
if n < 2 return 1
|
|
|
|
count = 2
|
|
for i = 2 to n/2
|
|
if not(mod(n, i)) count = count + 1
|
|
next
|
|
return count
|
|
end sub
|