Files
project_euler/44/main.ua
2025-10-04 08:30:25 +02:00

9 lines
240 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.
# pentagonal(n) ? n
P ← ÷2×⊸(-1×3)
# is_pentagonal(n) ? n
IsP ← =⟜⌊°P
⧅<2 P+1⇡3000 # pentagonal number pairs
▽⊸(/(↧∩IsP⊃+-)⍉) # sum and diff are pent
/-⊢ # get first such (which is minimal)