Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Gapful-numbers/Sidef/gapful-numbers.sidef
Normal file
16
Task/Gapful-numbers/Sidef/gapful-numbers.sidef
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
func is_gapful(n, base=10) {
|
||||
n.is_div(base*floor(n / base**n.ilog(base)) + n%base)
|
||||
}
|
||||
|
||||
var task = [
|
||||
"(Required) The first %s gapful numbers (>= %s)", 30, 1e2, 10,
|
||||
"(Required) The first %s gapful numbers (>= %s)", 15, 1e6, 10,
|
||||
"(Required) The first %s gapful numbers (>= %s)", 10, 1e9, 10,
|
||||
"(Extra) The first %s gapful numbers (>= %s)", 10, 987654321, 10,
|
||||
"(Extra) The first %s gapful numbers (>= %s)", 10, 987654321, 12,
|
||||
]
|
||||
|
||||
task.each_slice(4, {|title, n, from, b|
|
||||
say sprintf("\n#{title} for base #{b}:", n, from.commify)
|
||||
say (from..Inf -> lazy.grep{ is_gapful(_,b) }.first(n).join(' '))
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue