24 lines
463 B
Plaintext
24 lines
463 B
Plaintext
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);
|
|
];
|
|
]
|