Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Mertens-function/PureBasic/mertens-function.basic
Normal file
14
Task/Mertens-function/PureBasic/mertens-function.basic
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
Dim M.i(1000)
|
||||
|
||||
M(1)=1
|
||||
For n=2 To 1000
|
||||
psum=0
|
||||
For k=2 To n : psum+M(Int(n/k)) : Next : M(n)=1-psum
|
||||
If M(n)=0 : z+1 : If M(n-1)<>0 : c+1 : EndIf : EndIf
|
||||
Next
|
||||
|
||||
OpenConsole("")
|
||||
PrintN("First 99 Mertens numbers:") : Print(Space(4))
|
||||
For n=1 To 99 : Print(RSet(Str(M(n)),4)) : If n%10=9 : PrintN("") : EndIf : Next
|
||||
PrintN("M(N) is zero "+Str(z)+" times.") : PrintN("M(N) crosses zero "+Str(c)+" times.")
|
||||
Input()
|
||||
Loading…
Add table
Add a link
Reference in a new issue