Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
3
Task/M-bius-function/Sidef/m-bius-function-1.sidef
Normal file
3
Task/M-bius-function/Sidef/m-bius-function-1.sidef
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
say moebius(53) #=> -1
|
||||
say moebius(54) #=> 0
|
||||
say moebius(55) #=> 1
|
||||
11
Task/M-bius-function/Sidef/m-bius-function-2.sidef
Normal file
11
Task/M-bius-function/Sidef/m-bius-function-2.sidef
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
func μ(n) {
|
||||
var f = n.factor_exp.map { .tail }
|
||||
f.any { _ > 1 } ? 0 : ((-1)**f.sum)
|
||||
}
|
||||
|
||||
with (199) { |n|
|
||||
say "Values of the Möbius function for numbers in the range 1..#{n}:"
|
||||
[' '] + (1..n->map(μ)) -> each_slice(20, {|*line|
|
||||
say line.map { '%2s' % _ }.join(' ')
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue