start to solve 60
This commit is contained in:
15
60/main.ua
Normal file
15
60/main.ua
Normal file
@@ -0,0 +1,15 @@
|
||||
# project euler 60
|
||||
# ? n
|
||||
IsPrime ← memo(=1⧻°/×)
|
||||
# [all pair-concatenations of [n]] ? [n]
|
||||
Pairs ← ≡(⍜°⋕/◇⊂) ⧅≠2
|
||||
# [all primes 1 through n] ? n
|
||||
Primes ← +1⊚≡IsPrime+1⇡
|
||||
# do numbers [n] form all prime Pairs?
|
||||
# bool ? [n]
|
||||
Check ← /↧≡IsPrime Pairs
|
||||
|
||||
⍤⤙≍ 1 Check [3 7 109 673]
|
||||
|
||||
⧅<4 Primes 1000
|
||||
▽⊸≡Check
|
||||
Reference in New Issue
Block a user