Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,3 @@
say moebius(53) #=> -1
say moebius(54) #=> 0
say moebius(55) #=> 1

View 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(' ')
})
}