26 lines
447 B
Text
26 lines
447 B
Text
|
|
Dim Results(20)
|
||
|
|
Candidate = 1
|
||
|
|
max_divisors = 0
|
||
|
|
|
||
|
|
Print "Los primeros 20 anti-primos son:"
|
||
|
|
For j = 0 To 19
|
||
|
|
Do
|
||
|
|
divisors = count_divisors(Candidate)
|
||
|
|
If max_divisors < divisors Then
|
||
|
|
Results[j] = Candidate
|
||
|
|
max_divisors = divisors
|
||
|
|
Exit Do
|
||
|
|
End If
|
||
|
|
Candidate += 1
|
||
|
|
Until false
|
||
|
|
Print Results[j];" ";
|
||
|
|
Next j
|
||
|
|
|
||
|
|
Function count_divisors(n)
|
||
|
|
cont = 1
|
||
|
|
For i = 1 To n/2
|
||
|
|
If (n % i) = 0 Then cont += 1
|
||
|
|
Next i
|
||
|
|
count_divisors = cont
|
||
|
|
End Function
|