Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/M-bius-function/XPL0/m-bius-function.xpl0
Normal file
23
Task/M-bius-function/XPL0/m-bius-function.xpl0
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
func Mobius(N);
|
||||
int N, Cnt, F, K;
|
||||
[Cnt:= 0;
|
||||
F:= 2; K:= 0;
|
||||
repeat if rem(N/F) = 0 then
|
||||
[Cnt:= Cnt+1;
|
||||
N:= N/F;
|
||||
K:= K+1;
|
||||
if K >= 2 then return 0;
|
||||
]
|
||||
else [F:= F+1; K:= 0];
|
||||
until F > N;
|
||||
return if Cnt&1 then -1 else 1;
|
||||
];
|
||||
|
||||
int N;
|
||||
[Format(3, 0);
|
||||
Text(0, " ");
|
||||
for N:= 1 to 199 do
|
||||
[RlOut(0, float(Mobius(N)));
|
||||
if rem(N/20) = 19 then CrLf(0);
|
||||
];
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue