Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
32
Task/M-bius-function/11l/m-bius-function.11l
Normal file
32
Task/M-bius-function/11l/m-bius-function.11l
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
F isPrime(n)
|
||||
I n < 2
|
||||
R 0B
|
||||
L(i) 2 .. n
|
||||
I i * i <= n & n % i == 0
|
||||
R 0B
|
||||
R 1B
|
||||
|
||||
F mobius(n)
|
||||
I n == 1
|
||||
R 1
|
||||
|
||||
V p = 0
|
||||
L(i) 1 .. n
|
||||
I n % i == 0 & isPrime(i)
|
||||
I n % (i * i) == 0
|
||||
R 0
|
||||
E
|
||||
p = p + 1
|
||||
|
||||
I p % 2 != 0
|
||||
R -1
|
||||
E
|
||||
R 1
|
||||
|
||||
print(‘Mobius numbers from 1..99:’)
|
||||
|
||||
L(i) 1..99
|
||||
print(f:‘{mobius(i):4}’, end' ‘’)
|
||||
|
||||
I i % 20 == 0
|
||||
print()
|
||||
Loading…
Add table
Add a link
Reference in a new issue