Factors of an integer: Difference between revisions

m
J: We had two implementations of 'factors' here which produced the same result. Here, we disambiguate these implementations by renaming the slower variant.
m (J: We had two implementations of 'factors' here which produced the same result. Here, we disambiguate these implementations by renaming the slower variant.)
Line 3,665:
However, a data structure which is organized around the prime decomposition of the argument can be hard to read. So, for reader convenience, we should probably arrange them in a monotonically increasing list:
 
<syntaxhighlight lang="j"> factorsfactrst=: [: /:~@, */&>@{@((^ i.@>:)&.>/)@q:~&__
factorsfactrst 420
1 2 3 4 5 6 7 10 12 14 15 20 21 28 30 35 42 60 70 84 105 140 210 420</syntaxhighlight>
 
6,962

edits