Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
func isok(arr) {
|
||||
var diffs = arr.map_cons(2, {|a,b| a - b })
|
||||
diffs.count { .is_pos } == diffs.count { .is_neg }
|
||||
}
|
||||
|
||||
var base = 10
|
||||
|
||||
with (200) {|n|
|
||||
say "First #{n} terms (base #{base}):"
|
||||
n.by { isok(.digits(base)) && .is_pos }.each_slice(20, {|*a|
|
||||
say a.map { '%3s' % _ }.join(' ')
|
||||
})
|
||||
}
|
||||
|
||||
with (1e7) {|n| # takes a very long time
|
||||
say "\nThe #{n.commify}-th term (base #{base}): #{
|
||||
n.th { isok(.digits(base)) && .is_pos }.commify}"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue