Pythagorean triples: Difference between revisions

J: minor speedup -- mostly from discarding the "eliminate dups" step
(J: minor speedup -- mostly from discarding the "eliminate dups" step)
Line 189:
'm n'=. |:(#~ 1 = 2 | +/"1)(#~ >/"1),/,"0/~}.i.<.%:y
prim=. (#~ 1 = 2 +./@{. |:) (#~ y>:+/"1)m (-&*:,. +:@*,. +&*:) n
/:~;<@(,.~ e.&prim)# ~{./ 1:~;<)@(*/~ 1 + y i.@<.@% +/)"1 prim
)</lang>
 
6,962

edits