15 lines
434 B
Text
15 lines
434 B
Text
[] # list of primes to be populated
|
|
↘2⇡500 # candidates (starting at 2)
|
|
|
|
# Take the first remaining candidate, which will be prime, save it,
|
|
# then remove every candidate that it divides. Repeat until none left.
|
|
⍢(▽≠0◿⊃⊢(.↘1)⟜(⊂⊢)|>0⧻)
|
|
# Tidy up.
|
|
⇌◌
|
|
|
|
# Build sum of digits of each.
|
|
≡(/+≡⋕°⋕)...
|
|
# Mask out those that result in non-primes.
|
|
⊏⊚±⬚0⊏⊗
|
|
# Return values and length.
|
|
⧻.
|