Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,14 +1,14 @@
|
|||
def countDivisors(n)
|
||||
if (n < 2)
|
||||
return 1
|
||||
end
|
||||
count = 2
|
||||
for i in range(2, int(n/2))
|
||||
if (n % i) = 0
|
||||
count += 1
|
||||
end
|
||||
end
|
||||
return count
|
||||
if (n < 2)
|
||||
return 1
|
||||
end
|
||||
count = 2
|
||||
for i in range(2, int(n/2))
|
||||
if (n % i) = 0
|
||||
count += 1
|
||||
end
|
||||
end
|
||||
return count
|
||||
end
|
||||
|
||||
maxDiv = 0
|
||||
|
|
@ -16,11 +16,11 @@ count = 0
|
|||
println "The first 20 anti-primes are:"
|
||||
|
||||
for (n = 1) (count < 20) (n += 1)
|
||||
d = countDivisors(n)
|
||||
if d > maxDiv
|
||||
print format("%d ", n)
|
||||
maxDiv = d
|
||||
count += 1
|
||||
end
|
||||
d = countDivisors(n)
|
||||
if d > maxDiv
|
||||
print format("%d ", n)
|
||||
maxDiv = d
|
||||
count += 1
|
||||
end
|
||||
end
|
||||
println
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue