26 lines
518 B
Plaintext
26 lines
518 B
Plaintext
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 using("###", M(n));
|
|
if n mod 10 = 9 then print
|
|
next n
|
|
numCruza = 0
|
|
numEsCero = 0
|
|
for n = 1 to 1000
|
|
if M(n) = 0 then
|
|
numEsCero = numEsCero +1
|
|
if M(n-1) <> 0 then numCruza = numCruza +1
|
|
end if
|
|
next n
|
|
print
|
|
print "M(n) is zero "; numEsCero; " times."
|
|
print "M(n) crosses zero "; numCruza; " times."
|