Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Truncatable-primes/Sidef/truncatable-primes.sidef
Normal file
14
Task/Truncatable-primes/Sidef/truncatable-primes.sidef
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
func t_prime(n, left=true) {
|
||||
var p = %w(2 3 5 7);
|
||||
var f = (
|
||||
left ? { '1'..'9' ~X+ p }
|
||||
: { p ~X+ '1'..'9' }
|
||||
)
|
||||
n.times {
|
||||
p = f().grep{ .to_i.is_prime }
|
||||
}
|
||||
p.map{.to_i}.max
|
||||
}
|
||||
|
||||
say t_prime(5, left: true)
|
||||
say t_prime(5, left: false)
|
||||
Loading…
Add table
Add a link
Reference in a new issue