Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,24 @@
func ludics_upto(nmax=100000) {
Enumerator({ |collect|
collect(1)
var arr = @(2..nmax)
while (arr) {
collect(var n = arr[0])
arr.range.by(n).each {|i| arr[i] = nil}
arr.compact!
}
})
}
func ludics_first(n) {
ludics_upto(n * n.log2).first(n)
}
say("First 25 Ludic numbers: ", ludics_first(25).join(' '))
say("Ludics below 1000: ", ludics_upto(1000).len)
say("Ludic numbers 2000 to 2005: ", ludics_first(2005).last(6).join(' '))
var a = ludics_upto(250).to_a
say("Ludic triples below 250: ", a.grep{|x| a.contains_all([x+2, x+6]) } \
.map {|x| '(' + [x, x+2, x+6].join(' ') + ')' } \
.join(' '))