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,11 @@
func is_perfect(n) {
var sum = 0;
for i in (1 ..^ n) {
i.divides(n) && (sum += i);
}
sum == n;
}
10000.times { |i|
is_perfect(i) && say i;
}

View file

@ -0,0 +1,14 @@
func is_even_perfect(n) {
var square = (8*n + 1)
square.is_sqr || return false
var tp = ((square.isqrt + 1) / 2)
tp.is_pow || return false
(tp-1).is_prime ? true : false
}
for i in range(0, 10000, 2) {
is_even_perfect(i) && say i
}