Files
project_euler/60/main.ua
2025-09-22 01:02:19 +02:00

16 lines
347 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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