Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Summarize-primes/Sidef/summarize-primes.sidef
Normal file
7
Task/Summarize-primes/Sidef/summarize-primes.sidef
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
1000.primes.map_reduce {|a,b| a + b }.map_kv {|k,v|
|
||||
[k+1, prime(k+1), v]
|
||||
}.grep { .tail.is_prime }.prepend(
|
||||
['count', 'prime', 'sum']
|
||||
).each_2d {|n,p,s|
|
||||
printf("%5s %6s %8s\n", n, p, s)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue