Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
26
Task/Mertens-function/BASIC256/mertens-function.basic
Normal file
26
Task/Mertens-function/BASIC256/mertens-function.basic
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
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."
|
||||
Loading…
Add table
Add a link
Reference in a new issue