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