Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Mertens-function/BCPL/mertens-function.bcpl
Normal file
36
Task/Mertens-function/BCPL/mertens-function.bcpl
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
get "libhdr"
|
||||
|
||||
manifest $( limit = 1000 $)
|
||||
|
||||
let mertens(v, max) be
|
||||
$( v!1 := 1
|
||||
for n = 2 to max do
|
||||
$( v!n := 1
|
||||
for k = 2 to n do
|
||||
v!n := v!n - v!(n/k)
|
||||
$)
|
||||
$)
|
||||
|
||||
let start() be
|
||||
$( let m = vec limit
|
||||
let eqz, crossz = 0, 0
|
||||
|
||||
writes("The first 99 Mertens numbers are:*N")
|
||||
mertens(m, limit)
|
||||
for y=0 to 90 by 10 do
|
||||
$( for x=0 to 9 do
|
||||
test x+y=0
|
||||
then writes(" ")
|
||||
else writed(m!(x+y),3)
|
||||
wrch('*N')
|
||||
$)
|
||||
|
||||
for x=2 to limit do
|
||||
if m!x=0 then
|
||||
$( eqz := eqz + 1
|
||||
unless m!(x-1)=0 do crossz := crossz + 1
|
||||
$)
|
||||
|
||||
writef("M(N) is zero %N times.*N", eqz)
|
||||
writef("M(N) crosses zero %N times.*N", crossz)
|
||||
$)
|
||||
Loading…
Add table
Add a link
Reference in a new issue