Dear J,

I have a little function that outputs the fully permuted prime-factors of an input number.

perms =: 3 : 0
  n=: !N=: $q:y
  (i.n) A. q:y
)

   perms 12
2 2 3
2 3 2
2 2 3
2 3 2
3 2 2
3 2 2

How can J prevent that list's redundancies (as though in Bash I'd said "sort -u"), to get simply:

   perms 12
2 2 3
2 3 2
3 2 2

Thanks in advance for your time!

PA


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to