Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/M-bius-function/Arturo/m-bius-function.arturo
Normal file
12
Task/M-bius-function/Arturo/m-bius-function.arturo
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
mobius: function [n][
|
||||
if n=0 -> return ""
|
||||
if n=1 -> return 1
|
||||
f: factors.prime n
|
||||
|
||||
if f <> unique f -> return 0
|
||||
if? odd? size f -> return neg 1
|
||||
else -> return 1
|
||||
]
|
||||
|
||||
loop split.every:20 map 0..199 => mobius 'a ->
|
||||
print map a => [pad to :string & 3]
|
||||
Loading…
Add table
Add a link
Reference in a new issue