APL Hacking: Project Euler Daily (#10)
Problem #10:
∇R←PETEN;D;I;N;X;⎕IO ⎕IO←1⍝ Find the Sum of all the primes below two million.
N←2000000 ⋄ I←2 ⋄ X←N⍴1 ⋄ D←10000
LOOP:X[I×1↓⍳⌊N÷I]←0 ⋄ I←I+(I↓X)⍳1 ⋄ →((I*2)≤N)/LOOP
X←+/(2⍴D)⊤X/⍳NI←(⍴X[1])-4 ⋄ R←(X[1]+⌊X[2]÷D)(D|X[2])
∇