RosettaCodeData/Task/Summarize-primes/Uiua/summarize-primes.uiua
2024-10-16 18:07:41 -07:00

5 lines
321 B
Text
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.

IsPrime ← =1⧻°/× # °/× finds primes factors.
▽⊸≡IsPrime +1⇡1000 # Find primes in the target range.
▽⊙(⍉⊂+1⇡⧻⟜⊟:)⊸≡IsPrime\+. # Scan sums, only keeping prime sums.
&p$"Sequences of primes starting at 2 with prime sums\nLength\tLast\tSum"
≡(&p$"_\t_\t_" °[⊙⊙∘])