27 lines
477 B
Plaintext
27 lines
477 B
Plaintext
arraybase 1
|
|
dim M(1000)
|
|
M[1] = 1
|
|
for n = 2 to 1000
|
|
M[n] = 1
|
|
for k = 2 to n
|
|
M[n] = M[n] - M[int(n/k)]
|
|
next k
|
|
next n
|
|
print "First 99 Mertens numbers:"
|
|
print " ";
|
|
for n = 1 to 99
|
|
print rjust(string(M[n]),3);
|
|
if n mod 10 = 9 then print
|
|
next n
|
|
numCruza = 0
|
|
numEsCero = 0
|
|
for n = 1 to 1000
|
|
if M[n] = 0 then
|
|
numEsCero += 1
|
|
if M[n-1] <> 0 then numCruza += 1
|
|
end if
|
|
next n
|
|
print
|
|
print "M(n) is zero "; numEsCero; " times."
|
|
print "M(n) crosses zero "; numCruza; " times."
|