28 lines
535 B
Plaintext
28 lines
535 B
Plaintext
If OpenConsole()
|
|
Define.i n, m, i, limite
|
|
limite = 1001
|
|
Dim a.i(limite)
|
|
|
|
For n = 0 To limite-1
|
|
For m = n-1 To 0 Step -1
|
|
If a(m) = a(n)
|
|
a(n+1) = n-m
|
|
Break
|
|
EndIf
|
|
Next m
|
|
Next n
|
|
|
|
PrintN("Secuencia de Van Eck:" + #CRLF$)
|
|
Print("Primeros 10 terminos: ")
|
|
For i = 0 To 9
|
|
Print(Str(a(i)) + " ")
|
|
Next i
|
|
Print(#CRLF$ + "Terminos 991 al 1000: ")
|
|
For i = 990 To 999
|
|
Print(Str(a(i)) + " ")
|
|
Next i
|
|
|
|
PrintN(#CRLF$ + "Press ENTER to exit" + #CRLF$ ): Input()
|
|
CloseConsole()
|
|
EndIf
|