Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/Mertens-function/BASIC/mertens-function.basic
Normal file
19
Task/Mertens-function/BASIC/mertens-function.basic
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
10 DEFINT C,Z,N,K,M: DIM M(1000)
|
||||
20 M(1)=1
|
||||
30 FOR N=2 TO 1000
|
||||
40 M(N)=1
|
||||
50 FOR K=2 TO N: M(N) = M(N)-M(INT(N/K)): NEXT
|
||||
60 NEXT
|
||||
70 PRINT "First 99 Mertens numbers:"
|
||||
80 PRINT " ";
|
||||
90 FOR N=1 TO 99
|
||||
100 PRINT USING "###";M(N);
|
||||
110 IF N MOD 10 = 9 THEN PRINT
|
||||
120 NEXT
|
||||
130 C=0: Z=0
|
||||
140 FOR N=1 TO 1000
|
||||
150 IF M(N)=0 THEN Z=Z+1: IF M(N-1)<>0 THEN C=C+1
|
||||
160 NEXT
|
||||
170 PRINT "M(N) is zero";Z;"times."
|
||||
180 PRINT "M(N) crosses zero";C;"times."
|
||||
190 END
|
||||
Loading…
Add table
Add a link
Reference in a new issue