Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
14
Task/Arithmetic-numbers/Sidef/arithmetic-numbers.sidef
Normal file
14
Task/Arithmetic-numbers/Sidef/arithmetic-numbers.sidef
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
func is_arithmetic(n) {
|
||||
n.tau `divides` n.sigma
|
||||
}
|
||||
|
||||
say "The first one hundred arithmetic numbers:"
|
||||
100.by(is_arithmetic).each_slice(10, {|*a|
|
||||
a.map { '%3s' % _ }.join(' ').say
|
||||
})
|
||||
|
||||
for x in (1e3, 1e4, 1e5, 1e6) {
|
||||
var arr = x.by(is_arithmetic)
|
||||
say "\n#{x}th arithmetic number is #{arr.last}."
|
||||
say "There are #{arr.count{.is_composite}} composite arithmetic numbers <= #{arr.last}."
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue