41 lines
386 B
Plaintext
41 lines
386 B
Plaintext
define limit = 1000
|
|
|
|
dim list[limit]
|
|
|
|
print "calculating van eck sequence..."
|
|
|
|
for n = 0 to limit - 1
|
|
|
|
for m = n - 1 to 0 step -1
|
|
|
|
if list[m] = list[n] then
|
|
|
|
let c = n + 1
|
|
let list[c] = n - m
|
|
|
|
break m
|
|
|
|
endif
|
|
|
|
wait
|
|
|
|
next m
|
|
|
|
next n
|
|
|
|
print "first 10 terms: "
|
|
|
|
for i = 0 to 9
|
|
|
|
print list[i]
|
|
|
|
next i
|
|
|
|
print "terms 991 to 1000: "
|
|
|
|
for i = 990 to 999
|
|
|
|
print list[i]
|
|
|
|
next i
|