9 lines
330 B
Plaintext
9 lines
330 B
Plaintext
# project euler 43
|
|
p ← [2 3 5 7 11 13 17]
|
|
# joins digits in 3-window and checks for divisibility with p
|
|
# digit_array ? bool
|
|
s ← =0/↥ ◿p ⋕⧈₃(/⊂≡°⋕) ↘1
|
|
⧅≠∞ ⇡10 # all pandigital permutations
|
|
▽⊸≡s # keep all that satisfy prime divisibility
|
|
/+⋕≡(/⊂≡°⋕) # collect digits, sum
|